Skip to content

Commit 3084bb0

Browse files
mffrenchghaskins
authored andcommitted
[FAB-3208] Produce a container with fabric tools
Currently cryptogen and configtxgen are used to generate fabric PKI and configuration for peer and orderer. Adding these binaries inside of a container might make it easier for developers since at times it can be a little tricky with native binaries to connect to other running containers (e.g. using Docker for Windows) build : make tools-docker clean : make tools-docker-clean usage examples : FABRIC_ROOT=$GOPATH/src/github.com/hyperledger/fabric/ docker run --rm -v $FABRIC_ROOT/examples/e2e_cli/:/etc/hyperledger/fabric \ hyperledger/fabric-tools configtxgen -profile TwoOrgsOrdererGenesis \ -outputBlock /etc/hyperledger/fabric/channel-artifacts/orderer.gen.blk docker run --rm -v $FABRIC_ROOT/examples/e2e_cli/:/etc/hyperledger/fabric \ hyperledger/fabric-tools cryptogen generate \ --config=/etc/hyperledger/fabric/crypto-config.yaml Change-Id: I04b7434a4db00168e1e3ce9f5b91336b92d1f304 Signed-off-by: Mathilde Ffrench <[email protected]> Signed-off-by: Greg Haskins <[email protected]>
1 parent 5ba27bf commit 3084bb0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
# - docker[-clean] - ensures all docker images are available[/cleaned]
3636
# - peer-docker[-clean] - ensures the peer container is available[/cleaned]
3737
# - orderer-docker[-clean] - ensures the orderer container is available[/cleaned]
38+
# - tools-docker[-clean] - ensures the tools container is available[/cleaned]
3839
# - protos - generate all protobuf artifacts based on .proto files
3940
# - clean - cleans the build area
4041
# - dist-clean - superset of 'clean' that also removes persistent state
@@ -81,7 +82,7 @@ GOSHIM_DEPS = $(shell ./scripts/goListFiles.sh $(PKGNAME)/core/chaincode/shim)
8182
JAVASHIM_DEPS = $(shell git ls-files core/chaincode/shim/java)
8283
PROTOS = $(shell git ls-files *.proto | grep -v vendor)
8384
PROJECT_FILES = $(shell git ls-files)
84-
IMAGES = peer orderer ccenv javaenv buildenv testenv zookeeper kafka couchdb
85+
IMAGES = peer orderer ccenv javaenv buildenv testenv zookeeper kafka couchdb tools
8586
RELEASE_PLATFORMS = windows-amd64 darwin-amd64 linux-amd64 linux-ppc64le linux-s390x
8687
RELEASE_PKGS = configtxgen cryptogen
8788

@@ -130,6 +131,8 @@ configtxgen: build/bin/configtxgen
130131

131132
cryptogen: build/bin/cryptogen
132133

134+
tools-docker: build/image/tools/$(DUMMY)
135+
133136
javaenv: build/image/javaenv/$(DUMMY)
134137

135138
buildenv: build/image/buildenv/$(DUMMY)
@@ -232,6 +235,10 @@ build/image/kafka/payload: images/kafka/docker-entrypoint.sh \
232235
build/image/couchdb/payload: images/couchdb/docker-entrypoint.sh \
233236
images/couchdb/local.ini \
234237
images/couchdb/vm.args
238+
build/image/tools/payload: build/docker/bin/cryptogen \
239+
build/docker/bin/configtxgen \
240+
build/docker/bin/peer \
241+
build/sampleconfig.tar.bz2
235242

236243
build/image/%/payload:
237244
mkdir -p $@

images/tools/Dockerfile.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM _BASE_NS_/fabric-baseimage:_BASE_TAG_
2+
ENV FABRIC_CFG_PATH /etc/hyperledger/fabric
3+
VOLUME /etc/hyperledger/fabric
4+
ADD payload/sampleconfig.tar.bz2 $FABRIC_CFG_PATH
5+
COPY payload/cryptogen /usr/local/bin
6+
COPY payload/configtxgen /usr/local/bin
7+
COPY payload/peer /usr/local/bin
8+

0 commit comments

Comments
 (0)