Skip to content

Commit

Permalink
[FAB-1652] Switch runtime to baseos
Browse files Browse the repository at this point in the history
The peer/orderer containers are currently built on a custom
busybox base we call "runtime".  This results in superbly small
images (~25MB each).  However, it was discovered that we also
inadvertently broke DNS/gethostbyname() functions in glibc
as a result of doing this.  It was decided that the busybox
path, while small, was not a tenable solution for the long
term.  Therefore, we split the baseimage up into three
pieces: baseos, basejvm, and (the original) baseimage.

BaseOS gives us a relatively small os (64MB compressed for
release x86_64-0.3.0) but without the problematic DNS/glibc
issues.

Therefore, this patch removes our custom busybox build
from fabric.git and instead builds the peer/orderer
from hyperledger/fabric-baseos, which is now available
in dockerhub.  This has the side benefit of also speeding
up the build since we no longer need to compile busybox.

Change-Id: I0dd1c61ea5afd10402cf6830f8fc605378a259a7
Signed-off-by: Greg Haskins <gregory.haskins@gmail.com>
  • Loading branch information
ghaskins committed Jan 27, 2017
1 parent c9242fe commit 4301e41
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .baseimage-release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.2
0.3.0
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ PROTOS = $(shell git ls-files *.proto | grep -v vendor)
MSP_SAMPLECONFIG = $(shell git ls-files msp/sampleconfig/*.pem)
GENESIS_SAMPLECONFIG = $(shell git ls-files common/configtx/test/*.template)
PROJECT_FILES = $(shell git ls-files)
IMAGES = peer orderer ccenv javaenv testenv runtime zookeeper kafka
IMAGES = peer orderer ccenv javaenv testenv zookeeper kafka

pkgmap.peer := $(PKGNAME)/peer
pkgmap.orderer := $(PKGNAME)/orderer
Expand Down Expand Up @@ -153,19 +153,10 @@ build/docker/gotools: gotools/Makefile
hyperledger/fabric-baseimage:$(BASE_DOCKER_TAG) \
make install BINDIR=/opt/gotools/bin OBJDIR=/opt/gotools/obj

build/docker/busybox:
@$(DRUN) \
hyperledger/fabric-baseimage:$(BASE_DOCKER_TAG) \
make -f busybox/Makefile install BINDIR=$(@D)

# Both peer and peer-docker depend on ccenv and javaenv (all docker env images it supports).
build/bin/peer: build/image/ccenv/$(DUMMY) build/image/javaenv/$(DUMMY)
build/image/peer/$(DUMMY): build/image/ccenv/$(DUMMY) build/image/javaenv/$(DUMMY)

# Both peer-docker and orderer-docker depend on the runtime image
build/image/peer/$(DUMMY): build/image/runtime/$(DUMMY)
build/image/orderer/$(DUMMY): build/image/runtime/$(DUMMY)

build/bin/%: $(PROJECT_FILES)
@mkdir -p $(@D)
@echo "$@"
Expand Down Expand Up @@ -194,7 +185,6 @@ build/image/testenv/payload: build/gotools.tar.bz2 \
peer/core.yaml \
build/msp-sampleconfig.tar.bz2 \
images/testenv/install-softhsm2.sh
build/image/runtime/payload: build/docker/busybox
build/image/zookeeper/payload: images/zookeeper/docker-entrypoint.sh
build/image/kafka/payload: images/kafka/docker-entrypoint.sh

Expand Down
27 changes: 0 additions & 27 deletions busybox/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion images/orderer/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM hyperledger/fabric-runtime:_TAG_
FROM hyperledger/fabric-baseos:_BASE_TAG_
ENV ORDERER_CFG_PATH /etc/hyperledger/fabric/orderer
RUN mkdir -p /var/hyperledger/db /etc/hyperledger/fabric/orderer
COPY payload/orderer /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion images/peer/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM hyperledger/fabric-runtime:_TAG_
FROM hyperledger/fabric-baseos:_BASE_TAG_
ENV PEER_CFG_PATH /etc/hyperledger/fabric
RUN mkdir -p /var/hyperledger/db $PEER_CFG_PATH
COPY payload/peer /usr/local/bin
Expand Down
6 changes: 0 additions & 6 deletions images/runtime/Dockerfile.in

This file was deleted.

0 comments on commit 4301e41

Please sign in to comment.