Skip to content

Commit

Permalink
Use ccenv docker image rather than baseimage
Browse files Browse the repository at this point in the history
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 <gregory.haskins@gmail.com>
  • Loading branch information
ghaskins committed Sep 19, 2016
1 parent fb6f59b commit 79b70e4
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 31 deletions.
9 changes: 4 additions & 5 deletions core/chaincode/chaincodetest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,16 @@ chaincode:
# This is the basis for the Golang Dockerfile. Additional commands will
# be appended depedendent upon the chaincode specification.
Dockerfile: |
from hyperledger/fabric-baseimage
#from utxo:0.1.0
COPY src $GOPATH/src
WORKDIR $GOPATH
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
COPY src $GOPATH/src
WORKDIR $GOPATH
car:

# This is the basis for the CAR Dockerfile. Additional commands will
# be appended depedendent upon the chaincode specification.
Dockerfile: |
FROM hyperledger/fabric-baseimage
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
# timeout in millisecs for starting up a container and waiting for Register
# to come through. 1sec should be plenty for chaincode unit tests
Expand Down
6 changes: 3 additions & 3 deletions core/ledger/genesis/genesis_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ chaincode:

# This is the basis for the Golang Dockerfile. Additional commands will be appended depedendent upon the chaincode specification.
Dockerfile: |
from hyperledger/fabric-baseimage
COPY src $GOPATH/src
WORKDIR $GOPATH
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
COPY src $GOPATH/src
WORKDIR $GOPATH
#timeout for starting up a container and waiting for Register to come through
startuptimeout: 20000
Expand Down
9 changes: 4 additions & 5 deletions core/rest/rest_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,16 @@ chaincode:
# This is the basis for the Golang Dockerfile. Additional commands will
# be appended depedendent upon the chaincode specification.
Dockerfile: |
from hyperledger/fabric-baseimage
#from utxo:0.1.0
COPY src $GOPATH/src
WORKDIR $GOPATH
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
COPY src $GOPATH/src
WORKDIR $GOPATH
car:

# This is the basis for the CAR Dockerfile. Additional commands will
# be appended depedendent upon the chaincode specification.
Dockerfile: |
FROM hyperledger/fabric-ccenv
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
# timeout in millisecs for starting up a container and waiting for Register
# to come through. 1sec should be plenty for chaincode unit tests
Expand Down
3 changes: 2 additions & 1 deletion examples/chaincode/go/utxo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from hyperledger/fabric-baseimage
# FIXME: someone from the UTXO team will need to verify or rework this
FROM ubuntu:latest

RUN apt-get update && apt-get install pkg-config autoconf libtool -y
RUN cd /tmp && git clone https://github.com/bitcoin/secp256k1.git && cd secp256k1/
Expand Down
9 changes: 0 additions & 9 deletions membersrvc/Dockerfile

This file was deleted.

6 changes: 3 additions & 3 deletions membersrvc/ca/ca_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ chaincode:

# This is the basis for the Golang Dockerfile. Additional commands will be appended depedendent upon the chaincode specification.
Dockerfile: |
from hyperledger/fabric-baseimage
COPY src $GOPATH/src
WORKDIR $GOPATH
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
COPY src $GOPATH/src
WORKDIR $GOPATH
#timeout in millisecs for starting up a container and waiting for Register to come through. 1sec should be plenty for chaincode unit tests
startuptimeout: 1000
Expand Down
9 changes: 4 additions & 5 deletions peer/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,9 @@ chaincode:
# This is the basis for the Golang Dockerfile. Additional commands will
# be appended depedendent upon the chaincode specification.
Dockerfile: |
from hyperledger/fabric-baseimage
#from utxo:0.1.0
COPY src $GOPATH/src
WORKDIR $GOPATH
FROM hyperledger/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)
COPY src $GOPATH/src
WORKDIR $GOPATH
car:

Expand Down Expand Up @@ -416,7 +415,7 @@ security:
enabled: false

# TCerts pool configuration. Multi-thread pool can also be configured
# by multichannel option switching concurrency in communication with TCA.
# by multichannel option switching concurrency in communication with TCA.
multithreading:
enabled: false
multichannel: false
Expand Down

0 comments on commit 79b70e4

Please sign in to comment.