mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 03:25:09 +00:00
Fabric Docker Images
- Pull the fabric docker images locally - Push these to the local registry - Adjust yaml files to pull image from the local registry - If the fabric version is amd64-latest pull from the Fabric dev repo Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
This commit is contained in:
parent
0ea5e7762b
commit
813dc31ae2
18 changed files with 50 additions and 31 deletions
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-tools:{{FABRIC_VERSION}}
|
||||
image: localhost:5000/fabric-tools:kind
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: FABRIC_CFG_PATH
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-ca:1.5.2
|
||||
image: localhost:5000/fabric-ca:kind
|
||||
env:
|
||||
- name: FABRIC_CA_SERVER_CA_NAME
|
||||
value: "org0-ecert-ca"
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-orderer:{{FABRIC_VERSION}}
|
||||
imagePullPolicy: IfNotPresent
|
||||
image: localhost:5000/fabric-orderer:kind
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: org0-orderer1-env
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-orderer:{{FABRIC_VERSION}}
|
||||
imagePullPolicy: IfNotPresent
|
||||
image: localhost:5000/fabric-orderer:kind
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: org0-orderer2-env
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-orderer:{{FABRIC_VERSION}}
|
||||
imagePullPolicy: IfNotPresent
|
||||
image: localhost:5000/fabric-orderer:kind
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: org0-orderer3-env
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-ca:1.5.2
|
||||
image: localhost:5000/fabric-ca:kind
|
||||
env:
|
||||
- name: FABRIC_CA_SERVER_CA_NAME
|
||||
value: "org0-tls-ca"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-tools:{{FABRIC_VERSION}}
|
||||
image: localhost:5000/fabric-tools:kind
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: FABRIC_CFG_PATH
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-ca:1.5.2
|
||||
image: localhost:5000/fabric-ca:kind
|
||||
env:
|
||||
- name: FABRIC_CA_SERVER_CA_NAME
|
||||
value: "org1-ecert-ca"
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-peer:{{FABRIC_VERSION}}
|
||||
image: localhost:5000/fabric-peer:kind
|
||||
imagePullPolicy: IfNotPresent
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-peer:{{FABRIC_VERSION}}
|
||||
image: localhost:5000/fabric-peer:kind
|
||||
imagePullPolicy: IfNotPresent
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-ca:1.5.2
|
||||
image: localhost:5000/fabric-ca:kind
|
||||
env:
|
||||
- name: FABRIC_CA_SERVER_CA_NAME
|
||||
value: "org1-tls-ca"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-tools:{{FABRIC_VERSION}}
|
||||
image: localhost:5000/fabric-tools:kind
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: FABRIC_CFG_PATH
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-ca:1.5.2
|
||||
image: localhost:5000/fabric-ca:kind
|
||||
env:
|
||||
- name: FABRIC_CA_SERVER_CA_NAME
|
||||
value: "org2-ecert-ca"
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-peer:{{FABRIC_VERSION}}
|
||||
image: localhost:5000/fabric-peer:kind
|
||||
imagePullPolicy: IfNotPresent
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-peer:{{FABRIC_VERSION}}
|
||||
image: localhost:5000/fabric-peer:kind
|
||||
imagePullPolicy: IfNotPresent
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: main
|
||||
image: hyperledger/fabric-ca:1.5.2
|
||||
image: localhost:5000/fabric-ca:kind
|
||||
env:
|
||||
- name: FABRIC_CA_SERVER_CA_NAME
|
||||
value: "org2-tls-ca"
|
||||
|
|
|
|||
|
|
@ -5,16 +5,6 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function pull_docker_images() {
|
||||
push_fn "Pulling docker images for Fabric ${FABRIC_VERSION}"
|
||||
|
||||
docker pull hyperledger/fabric-ca:$FABRIC_CA_VERSION
|
||||
docker pull hyperledger/fabric-orderer:$FABRIC_VERSION
|
||||
docker pull hyperledger/fabric-peer:$FABRIC_VERSION
|
||||
docker pull hyperledger/fabric-tools:$FABRIC_VERSION
|
||||
|
||||
pop_fn
|
||||
}
|
||||
|
||||
function apply_nginx_ingress() {
|
||||
push_fn "Launching Nginx ingress controller"
|
||||
|
|
@ -80,7 +70,7 @@ function launch_docker_registry() {
|
|||
running="$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)"
|
||||
if [ "${running}" != 'true' ]; then
|
||||
docker run \
|
||||
-d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \
|
||||
-d --restart=always --rm -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \
|
||||
registry:2
|
||||
fi
|
||||
|
||||
|
|
@ -123,7 +113,6 @@ function kind_init() {
|
|||
# todo: how to pass this through to push_fn ?
|
||||
set -o errexit
|
||||
|
||||
pull_docker_images
|
||||
kind_create
|
||||
apply_nginx_ingress
|
||||
launch_docker_registry
|
||||
|
|
|
|||
|
|
@ -7,6 +7,33 @@
|
|||
|
||||
# todo: oof this is rough.
|
||||
|
||||
function pull_docker_images() {
|
||||
local registry
|
||||
push_fn "Pulling docker images for Fabric ${FABRIC_VERSION}"
|
||||
|
||||
if [ "${FABRIC_VERSION}" = "amd64-latest" ]; then
|
||||
FABRIC_CA_VERSION=${FABRIC_VERSION}
|
||||
registry=hyperledger-fabric.jfrog.io
|
||||
else
|
||||
registry=hyperledger
|
||||
fi
|
||||
|
||||
for image in peer orderer tools; do
|
||||
local fullname=$registry/fabric-${image}:$FABRIC_VERSION
|
||||
docker pull ${fullname}
|
||||
docker tag ${fullname} "localhost:5000/fabric-${image}:kind"
|
||||
docker push "localhost:5000/fabric-${image}:kind"
|
||||
done
|
||||
|
||||
local cafullname=$registry/fabric-ca:$FABRIC_CA_VERSION
|
||||
docker pull ${cafullname}
|
||||
docker tag ${cafullname} "localhost:5000/fabric-ca:kind"
|
||||
docker push "localhost:5000/fabric-ca:kind"
|
||||
|
||||
|
||||
pop_fn
|
||||
|
||||
}
|
||||
|
||||
function launch() {
|
||||
local yaml=$1
|
||||
|
|
@ -205,6 +232,9 @@ function create_local_MSP() {
|
|||
|
||||
function network_up() {
|
||||
|
||||
# get the fabric docker images pushed to the local repository
|
||||
pull_docker_images
|
||||
|
||||
# Kube config
|
||||
init_namespace
|
||||
init_storage_volumes
|
||||
|
|
|
|||
Loading…
Reference in a new issue