Skip to content

Commit 3dffd28

Browse files
committed
[FAB-7095] configurable pulling of cc base images
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>
1 parent 0754678 commit 3dffd28

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

core/container/dockercontroller/dockercontroller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (vm *DockerVM) deployImage(client dockerClient, ccid ccintf.CCID,
179179
outputbuf := bytes.NewBuffer(nil)
180180
opts := docker.BuildImageOptions{
181181
Name: id,
182-
Pull: false,
182+
Pull: viper.GetBool("chaincode.pull"),
183183
InputStream: reader,
184184
OutputStream: outputbuf,
185185
}

sampleconfig/core.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ chaincode:
435435
# Generic builder environment, suitable for most chaincode types
436436
builder: $(DOCKER_NS)/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
437437

438+
# Enables/disables force pulling of the base docker images (listed below)
439+
# during user chaincode instantiation.
440+
# Useful when using moving image tags (such as :latest)
441+
pull: false
442+
438443
golang:
439444
# golang will never need more than baseos
440445
runtime: $(BASE_DOCKER_NS)/fabric-baseos:$(ARCH)-$(BASE_VERSION)

0 commit comments

Comments
 (0)