Skip to content

Commit

Permalink
[FAB-6050] Add fabric images with fabric-ca-client
Browse files Browse the repository at this point in the history
This change set builds 3 new docker images:
1) fabric-ca-orderer
   Extends fabric-orderer and adds fabric-ca-client to enroll the orderer.
2) fabric-ca-peer
   Extends fabric-peer  and adds fabric-ca-client to enroll the peer.
3) fabric-ca-tools
   Extends fabric-tools  and adds fabric-ca-client to talk to fabric-ca-server.

These images will be used by fabric-samples/fabric-ca which will be an
end-to-end sample for using fabric CA with fabric.

Change-Id: I4c56bedac1a4337073ee12f8af32955c3e2b4522
Signed-off-by: Keith Smith <[email protected]>
  • Loading branch information
Keith Smith committed Sep 25, 2017
1 parent 1ab60e0 commit b21aa3b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 10 deletions.
29 changes: 19 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ BASE_VERSION = 1.0.1
PREV_VERSION = 1.0.0
IS_RELEASE = false

ARCH=$(shell uname -m)

ifneq ($(IS_RELEASE),true)
EXTRA_VERSION ?= snapshot-$(shell git rev-parse --short HEAD)
PROJECT_VERSION=$(BASE_VERSION)-$(EXTRA_VERSION)
FABRIC_TAG ?= $(ARCH)-$(PREV_VERSION)
else
PROJECT_VERSION=$(BASE_VERSION)
FABRIC_TAG ?= $(ARCH)-$(BASE_VERSION)
endif

ARCH=$(shell uname -m)
ifeq ($(ARCH),s390x)
PGVER=9.4
else
Expand All @@ -58,7 +61,7 @@ GO_LDFLAGS = $(patsubst %,-X $(PKGNAME)/cmd.%,$(METADATA_VAR))
export GO_LDFLAGS

DOCKER_ORG = hyperledger
IMAGES = $(PROJECT_NAME)
IMAGES = $(PROJECT_NAME) $(PROJECT_NAME)-orderer $(PROJECT_NAME)-peer $(PROJECT_NAME)-tools
FVTIMAGE = $(PROJECT_NAME)-fvt

path-map.fabric-ca-client := ./cmd/fabric-ca-client
Expand Down Expand Up @@ -130,6 +133,7 @@ build/image/%/$(DUMMY): Makefile build/image/%/payload
@echo "Building docker $(TARGET) image"
@cat images/$(TARGET)/Dockerfile.in \
| sed -e 's/_BASE_TAG_/$(BASE_DOCKER_TAG)/g' \
| sed -e 's/_FABRIC_TAG_/$(FABRIC_TAG)/g' \
| sed -e 's/_TAG_/$(DOCKER_TAG)/g' \
| sed -e 's/_PGVER_/$(PGVER)/g' \
> $(@D)/Dockerfile
Expand All @@ -145,6 +149,12 @@ build/image/fabric-ca-fvt/payload: \
build/docker/bin/fabric-ca-client \
build/docker/bin/fabric-ca-server \
build/fabric-ca-fvt.tar.bz2
build/image/fabric-ca-orderer/payload: \
build/docker/bin/fabric-ca-client
build/image/fabric-ca-peer/payload: \
build/docker/bin/fabric-ca-client
build/image/fabric-ca-tools/payload: \
build/docker/bin/fabric-ca-client
build/image/%/payload:
@echo "Copying $^ to $@"
mkdir -p $@
Expand Down Expand Up @@ -175,22 +185,21 @@ bench-cpu: checks fabric-ca-server fabric-ca-client
bench-mem: checks fabric-ca-server fabric-ca-client
@scripts/run_benchmarks -M -P $(pkg)

# Removes all benchmark related files (bench, bench-cpu, bench-mem and *.test)
bench-clean:
@scripts/run_benchmarks -R

# Compares benchmarks results of current and previous release
# Previous release git tag must be specified using the prev_rel variable.
# e.g. make benchcmp prev_rel=v1.0.0
benchcmp: guard-prev_rel bench
@scripts/compare_benchmarks $(prev_rel)

guard-%:
@ if [ "${${*}}" = "" ]; then \
@if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi


# Removes all benchmark related files (bench, bench-cpu, bench-mem and *.test)
bench-clean:
@scripts/run_benchmarks -R

container-tests: docker

load-test: docker-clean docker-fvt
Expand Down
8 changes: 8 additions & 0 deletions images/fabric-ca-orderer/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-orderer:_FABRIC_TAG_
COPY payload/fabric-ca-client /usr/local/bin
RUN chmod +x /usr/local/bin/fabric-ca-client
8 changes: 8 additions & 0 deletions images/fabric-ca-peer/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-peer:_FABRIC_TAG_
COPY payload/fabric-ca-client /usr/local/bin
RUN chmod +x /usr/local/bin/fabric-ca-client
8 changes: 8 additions & 0 deletions images/fabric-ca-tools/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-tools:_FABRIC_TAG_
COPY payload/fabric-ca-client /usr/local/bin
RUN chmod +x /usr/local/bin/fabric-ca-client

0 comments on commit b21aa3b

Please sign in to comment.