Skip to content

Commit

Permalink
[CE-409] Add fabric initial image build
Browse files Browse the repository at this point in the history
Fabric initial image is using for generate crypto config files.

Change-Id: Ie71876968602e48fd10d6d19e7b3540d972b791f
Signed-off-by: Haitao Yue <hightall@me.com>
  • Loading branch information
hightall committed Jul 6, 2018
1 parent 0a86b97 commit a969010
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ else
endif

# Docker images needed to run cello services
DOCKER_IMAGES = baseimage mongo engine operator-dashboard ansible-agent watchdog user-dashboard
DOCKER_IMAGES = baseimage mongo engine operator-dashboard ansible-agent watchdog user-dashboard fabric-initial
DUMMY = .$(IMG_TAG)

ifeq ($(DOCKER_BASE), )
Expand Down Expand Up @@ -137,7 +137,7 @@ docker-operator-dashboard: build/docker/operator-dashboard/$(DUMMY)

docker-clean: stop image-clean ##@Clean all existing images

DOCKERHUB_IMAGES = baseimage engine operator-dashboard user-dashboard watchdog ansible-agent
DOCKERHUB_IMAGES = baseimage engine operator-dashboard user-dashboard watchdog ansible-agent fabric-initial

dockerhub: $(patsubst %,dockerhub-%,$(DOCKERHUB_IMAGES)) ##@Building latest images with dockerhub materials, to valid them

Expand Down
22 changes: 22 additions & 0 deletions dockerhub/v1.0.6/fabric-initial/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-tools:x86_64-1.0.6

ENV FABRIC_VERSION 1.0.6

RUN git clone -b v${FABRIC_VERSION} --depth 1 https://github.com/hyperledger/fabric-samples.git && \
mkdir -p ~/generate-crypto/channel-artifacts && cd fabric-samples/first-network && \
cp docker-compose-e2e-template.yaml byfn.sh configtx.yaml crypto-config.yaml ~/generate-crypto && \
sed -i '/ask for confirmation to proceed/,+1 d' ~/generate-crypto/byfn.sh && \
rm -rf /tmp/*

WORKDIR /root/generate-crypto
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& mkdir /root/bin && tar -C /root/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
ENV CHANNEL_NAME mychannel
COPY initial.sh /root/
CMD bash /root/initial.sh
3 changes: 3 additions & 0 deletions dockerhub/v1.0.6/fabric-initial/initial.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

cd ~/generate-crypto/ && ./byfn.sh -m generate -c ${CHANNEL_NAME} && cp -r crypto-config channel-artifacts ~/crypto-files/
22 changes: 22 additions & 0 deletions dockerhub/v1.1.0/fabric-initial/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-tools:x86_64-1.1.0

ENV FABRIC_VERSION 1.1.0

RUN git clone -b v${FABRIC_VERSION} --depth 1 https://github.com/hyperledger/fabric-samples.git && \
mkdir -p ~/generate-crypto/channel-artifacts && cd fabric-samples/first-network && \
cp docker-compose-e2e-template.yaml byfn.sh configtx.yaml crypto-config.yaml ~/generate-crypto && \
sed -i '/ask for confirmation to proceed/,+1 d' ~/generate-crypto/byfn.sh && \
rm -rf /tmp/*

WORKDIR /root/generate-crypto
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& mkdir /root/bin && tar -C /root/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
ENV CHANNEL_NAME mychannel
COPY initial.sh /root/
CMD bash /root/initial.sh
3 changes: 3 additions & 0 deletions dockerhub/v1.1.0/fabric-initial/initial.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

cd ~/generate-crypto/ && ./byfn.sh -m generate -c ${CHANNEL_NAME} && cp -r crypto-config channel-artifacts ~/crypto-files/

0 comments on commit a969010

Please sign in to comment.