Skip to content

Commit

Permalink
FAB-10410 Update Dockerfiles to use DOCKER_NS
Browse files Browse the repository at this point in the history
Update Makefile and Dockerfiles to use the BASE_DOCKER_NS
and DOCKER_NS. This helps users to build images with
custom name space. By default "make docker" uses the
default name space but to build custom namespace user has
to follow the below syntax.

nexus3 is a docker namespace
DOCKER_NS=nexus3 BASE_DOCKER_NS=nexus3 make docker

Change-Id: I7bc9e6987e94b7c1e6470ecfc1d84c7eff2a0fc9
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
  • Loading branch information
rameshthoomu committed May 26, 2018
1 parent d16dab1 commit db9ecd3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Makefile
Expand Up @@ -28,7 +28,7 @@
# - dist-clean - cleans release packages for all target platforms
# - clean-all - cleans the build area and release packages

PROJECT_NAME = fabric-ca
PROJECT_NAME = fabric-ca
BASE_VERSION = 1.2.0
PREV_VERSION = 1.1.0
IS_RELEASE = false
Expand Down Expand Up @@ -129,6 +129,8 @@ build/image/%/$(DUMMY): Makefile build/image/%/payload
$(eval DOCKER_NAME = $(DOCKER_NS)/$(TARGET))
@echo "Building docker $(TARGET) image"
@cat images/$(TARGET)/Dockerfile.in \
| sed -e 's/_BASE_NS_/$(BASE_DOCKER_NS)/g' \
| sed -e 's/_NS_/$(DOCKER_NS)/g' \
| sed -e 's/_BASE_TAG_/$(BASE_DOCKER_TAG)/g' \
| sed -e 's/_FABRIC_TAG_/$(FABRIC_TAG)/g' \
| sed -e 's/_TAG_/$(DOCKER_TAG)/g' \
Expand Down Expand Up @@ -215,7 +217,7 @@ fvt-tests:
@scripts/run_fvt_tests

ci-tests: docker-clean docker-fvt all-tests docs
@docker run -v $(shell pwd):/opt/gopath/src/github.com/hyperledger/fabric-ca hyperledger/fabric-ca-fvt
@docker run -v $(shell pwd):/opt/gopath/src/github.com/hyperledger/fabric-ca ${DOCKER_NS}/fabric-ca-fvt

%-docker-clean:
$(eval TARGET = ${patsubst %-docker-clean,%,${@}})
Expand Down
2 changes: 1 addition & 1 deletion images/fabric-ca-fvt/Dockerfile.in
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-baseimage:_BASE_TAG_
FROM _NS_/fabric-baseimage:_BASE_TAG_

ENV PATH="/usr/local/go/bin/:${PATH}" \
DEBIAN_FRONTEND="noninteractive" \
Expand Down
2 changes: 1 addition & 1 deletion images/fabric-ca-orderer/Dockerfile.in
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-orderer:_FABRIC_TAG_
FROM _NS_/fabric-orderer:_FABRIC_TAG_
COPY payload/fabric-ca-client /usr/local/bin
ARG FABRIC_CA_DYNAMIC_LINK=false
RUN chmod +x /usr/local/bin/fabric-ca-client
Expand Down
2 changes: 1 addition & 1 deletion images/fabric-ca-peer/Dockerfile.in
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-peer:_FABRIC_TAG_
FROM _NS_/fabric-peer:_FABRIC_TAG_
COPY payload/fabric-ca-client /usr/local/bin
ARG FABRIC_CA_DYNAMIC_LINK=false
RUN chmod +x /usr/local/bin/fabric-ca-client
Expand Down
2 changes: 1 addition & 1 deletion images/fabric-ca-tools/Dockerfile.in
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-tools:_FABRIC_TAG_
FROM _NS_/fabric-tools:_FABRIC_TAG_
COPY payload/fabric-ca-client /usr/local/bin
RUN chmod +x /usr/local/bin/fabric-ca-client
RUN apt-get update
Expand Down
2 changes: 1 addition & 1 deletion images/fabric-ca/Dockerfile.in
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-baseos:_BASE_TAG_
FROM _BASE_NS_/fabric-baseos:_BASE_TAG_
ENV FABRIC_CA_HOME /etc/hyperledger/fabric-ca-server
ARG FABRIC_CA_DYNAMIC_LINK=false
RUN mkdir -p $FABRIC_CA_HOME /var/hyperledger/fabric-ca-server
Expand Down

0 comments on commit db9ecd3

Please sign in to comment.