Skip to content

Commit 79b70e4

Browse files
committed
Use ccenv docker image rather than baseimage
We want baseimage to only be used as a mechanism to assist the build, not referenced at runtime. Therefore, we convert most instances of "baseimage" to use "ccenv" (chaincode environment) since this is what they really want anyway. Note 1: A few instances (such as the UTXO example) did not have an obvious solution so I left those to be sorted out by the respective subsystem owners. Note 2: The GOLANG chaincode type is currently a little suboptimal in that the fabric-ccenv image loads the full fabric.git src at build time and then the runtime re-injects it. In the future the build will only inject the golang shim and the runtime will only inject the chaincode. For now, this is somewhat inefficient but ultimately still results in correct behavior. Change-Id: I7f025bfff147fcca0f29f1656c7f63adc7a17173 Signed-off-by: Greg Haskins <[email protected]>
1 parent fb6f59b commit 79b70e4

File tree

7 files changed

+20
-31
lines changed

7 files changed

+20
-31
lines changed

core/chaincode/chaincodetest.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,16 @@ chaincode:
354354
# This is the basis for the Golang Dockerfile. Additional commands will
355355
# be appended depedendent upon the chaincode specification.
356356
Dockerfile: |
357-
from hyperledger/fabric-baseimage
358-
#from utxo:0.1.0
359-
COPY src $GOPATH/src
360-
WORKDIR $GOPATH
357+
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
358+
COPY src $GOPATH/src
359+
WORKDIR $GOPATH
361360
362361
car:
363362

364363
# This is the basis for the CAR Dockerfile. Additional commands will
365364
# be appended depedendent upon the chaincode specification.
366365
Dockerfile: |
367-
FROM hyperledger/fabric-baseimage
366+
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
368367
369368
# timeout in millisecs for starting up a container and waiting for Register
370369
# to come through. 1sec should be plenty for chaincode unit tests

core/ledger/genesis/genesis_test.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ chaincode:
178178

179179
# This is the basis for the Golang Dockerfile. Additional commands will be appended depedendent upon the chaincode specification.
180180
Dockerfile: |
181-
from hyperledger/fabric-baseimage
182-
COPY src $GOPATH/src
183-
WORKDIR $GOPATH
181+
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
182+
COPY src $GOPATH/src
183+
WORKDIR $GOPATH
184184
185185
#timeout for starting up a container and waiting for Register to come through
186186
startuptimeout: 20000

core/rest/rest_test.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -296,17 +296,16 @@ chaincode:
296296
# This is the basis for the Golang Dockerfile. Additional commands will
297297
# be appended depedendent upon the chaincode specification.
298298
Dockerfile: |
299-
from hyperledger/fabric-baseimage
300-
#from utxo:0.1.0
301-
COPY src $GOPATH/src
302-
WORKDIR $GOPATH
299+
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
300+
COPY src $GOPATH/src
301+
WORKDIR $GOPATH
303302
304303
car:
305304

306305
# This is the basis for the CAR Dockerfile. Additional commands will
307306
# be appended depedendent upon the chaincode specification.
308307
Dockerfile: |
309-
FROM hyperledger/fabric-ccenv
308+
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
310309
311310
# timeout in millisecs for starting up a container and waiting for Register
312311
# to come through. 1sec should be plenty for chaincode unit tests

examples/chaincode/go/utxo/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from hyperledger/fabric-baseimage
1+
# FIXME: someone from the UTXO team will need to verify or rework this
2+
FROM ubuntu:latest
23

34
RUN apt-get update && apt-get install pkg-config autoconf libtool -y
45
RUN cd /tmp && git clone https://github.com/bitcoin/secp256k1.git && cd secp256k1/

membersrvc/Dockerfile

-9
This file was deleted.

membersrvc/ca/ca_test.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ chaincode:
240240

241241
# This is the basis for the Golang Dockerfile. Additional commands will be appended depedendent upon the chaincode specification.
242242
Dockerfile: |
243-
from hyperledger/fabric-baseimage
244-
COPY src $GOPATH/src
245-
WORKDIR $GOPATH
243+
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
244+
COPY src $GOPATH/src
245+
WORKDIR $GOPATH
246246
247247
#timeout in millisecs for starting up a container and waiting for Register to come through. 1sec should be plenty for chaincode unit tests
248248
startuptimeout: 1000

peer/core.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,9 @@ chaincode:
282282
# This is the basis for the Golang Dockerfile. Additional commands will
283283
# be appended depedendent upon the chaincode specification.
284284
Dockerfile: |
285-
from hyperledger/fabric-baseimage
286-
#from utxo:0.1.0
287-
COPY src $GOPATH/src
288-
WORKDIR $GOPATH
285+
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
286+
COPY src $GOPATH/src
287+
WORKDIR $GOPATH
289288
290289
car:
291290

@@ -416,7 +415,7 @@ security:
416415
enabled: false
417416

418417
# TCerts pool configuration. Multi-thread pool can also be configured
419-
# by multichannel option switching concurrency in communication with TCA.
418+
# by multichannel option switching concurrency in communication with TCA.
420419
multithreading:
421420
enabled: false
422421
multichannel: false

0 commit comments

Comments
 (0)