Skip to content

Commit

Permalink
feat(tools): fabric all-in-one 2.x add nodejs to image
Browse files Browse the repository at this point in the history
This is necessary so that the AIO image can compile Typescript
contracts down into Javascript for the NodeJS
chaincode runtime.

Tagged on DockerHub as
hyperledger/cactus-fabric2-all-in-one:2021-04-20-nodejs

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Apr 23, 2021
1 parent 2016750 commit dc09540
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tools/docker/fabric-all-in-one/Dockerfile_v2.x
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ RUN apk add --no-cache curl
# The file binary is used to inspect exectubles when debugging container image issues
RUN apk add --no-cache file

# Need NodeJS tooling for the Typescript contracts
RUN apk add --no-cache npm nodejs

# Download and setup path variables for Go
RUN wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
RUN tar -xvf go1.15.5.linux-amd64.tar.gz
Expand Down Expand Up @@ -134,13 +137,15 @@ RUN chmod +x /download-frozen-image-v2.sh
RUN mkdir -p /etc/hyperledger/fabric/fabric-peer/
RUN mkdir -p /etc/hyperledger/fabric/fabric-orderer/
RUN mkdir -p /etc/hyperledger/fabric/fabric-ccenv/
RUN mkdir -p /etc/hyperledger/fabric/fabric-nodeenv/
RUN mkdir -p /etc/hyperledger/fabric/fabric-tools/
RUN mkdir -p /etc/hyperledger/fabric/fabric-baseos/
RUN mkdir -p /etc/hyperledger/fabric/fabric-ca/
RUN /download-frozen-image-v2.sh /etc/hyperledger/fabric/fabric-peer/ hyperledger/fabric-peer:${FABRIC_VERSION}
RUN /download-frozen-image-v2.sh /etc/hyperledger/fabric/fabric-orderer/ hyperledger/fabric-orderer:${FABRIC_VERSION}
RUN /download-frozen-image-v2.sh /etc/hyperledger/fabric/fabric-ccenv/ hyperledger/fabric-ccenv:${FABRIC_VERSION}
RUN /download-frozen-image-v2.sh /etc/hyperledger/fabric/fabric-nodeenv/ hyperledger/fabric-nodeenv:${FABRIC_VERSION}
RUN /download-frozen-image-v2.sh /etc/hyperledger/fabric/fabric-tools/ hyperledger/fabric-tools:${FABRIC_VERSION}
RUN /download-frozen-image-v2.sh /etc/hyperledger/fabric/fabric-baseos/ hyperledger/fabric-baseos:${FABRIC_VERSION}
RUN /download-frozen-image-v2.sh /etc/hyperledger/fabric/fabric-ca/ hyperledger/fabric-ca:${CA_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion tools/docker/fabric-all-in-one/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Example `.vscode/tasks.json` file for building/running the image:
From the project root:

```sh
docker build ./tools/docker/fabric-all-in-one/ -f ./tools/docker/fabric-all-in-one/Dockerfile_v2.x -t faio2x
DOCKER_BUILDKIT=1 docker build ./tools/docker/fabric-all-in-one/ -f ./tools/docker/fabric-all-in-one/Dockerfile_v2.x -t faio2x
docker run --detach --privileged --publish-all --env FABRIC_VERSION=2.2.0 faio2x

docker ps
Expand Down
1 change: 1 addition & 0 deletions tools/docker/fabric-all-in-one/run-fabric-network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function main()

# Fabric 2.x has this new image called fabric-baseos so we need to load that
# as well when we detect that we are running Fabrix 2.x not 1.x
tar -cC '/etc/hyperledger/fabric/fabric-nodeenv/' . | docker load
tar -cC '/etc/hyperledger/fabric/fabric-baseos/' . | docker load

/bootstrap.sh ${FABRIC_VERSION} ${CA_VERSION} -b -s
Expand Down

0 comments on commit dc09540

Please sign in to comment.