Skip to content

Commit

Permalink
[FAB-7095] configurable pulling of cc base images
Browse files Browse the repository at this point in the history
Currently, when chaincode is instantiated, the pulling of baseos
is explicitly set to false. This commit adds a new configuration
option under the docker section which allows one to force the
pulling of baseos. By default, it is set to false which maintains
the current behaviour.

This change may help address situations where a base image is updated
(eg: to patch vulnerabilities) and a peer cluster is using a generic
moving tag for baseos such as "latest".

Change-Id: I39af030ce26dcd3282ec4e762f8ed217ea6dfe9b
Signed-off-by: gbolo <george.bolo@gmail.com>
  • Loading branch information
gbolo committed Nov 28, 2017
1 parent 0754678 commit 3dffd28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/container/dockercontroller/dockercontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (vm *DockerVM) deployImage(client dockerClient, ccid ccintf.CCID,
outputbuf := bytes.NewBuffer(nil)
opts := docker.BuildImageOptions{
Name: id,
Pull: false,
Pull: viper.GetBool("chaincode.pull"),
InputStream: reader,
OutputStream: outputbuf,
}
Expand Down
5 changes: 5 additions & 0 deletions sampleconfig/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,11 @@ chaincode:
# Generic builder environment, suitable for most chaincode types
builder: $(DOCKER_NS)/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)

# Enables/disables force pulling of the base docker images (listed below)
# during user chaincode instantiation.
# Useful when using moving image tags (such as :latest)
pull: false

golang:
# golang will never need more than baseos
runtime: $(BASE_DOCKER_NS)/fabric-baseos:$(ARCH)-$(BASE_VERSION)
Expand Down

0 comments on commit 3dffd28

Please sign in to comment.