Search code examples
dockerhyperledger-fabrichyperledger

Error building hyper ledger fabric docker image


I am trying to build a hyper ledger fabric image, because here https://hyperledger-fabric.readthedocs.io/en/release-2.2/hsm.html they say: "The prebuilt Hyperledger Fabric Docker images are not enabled to use PKCS11. If you are deploying Fabric using docker, you need to build your own images and enable PKCS11 using the following command: make docker GO_TAGS=pkcs11" There's no more information about it, so I supposed I had to get the docker file of an image and build it, i found the docker files here: https://github.com/hyperledger/fabric/blob/main/images/orderer/Dockerfile

First, I tried to build it without any modifications or custom paremeters to see if it works, but it doesnt, it shows:

docker build -t myimagehlf .
Sending build context to Docker daemon  3.072kB
Step 1/22 : ARG GO_VER
Step 2/22 : ARG ALPINE_VER
Step 3/22 : FROM alpine:${ALPINE_VER} as base
invalid reference format

I think the error is on this line 'RUN apk add --no-cache tzdata', which is the fourth line of the docke file, but i have no idea why that's happening or how to fix it. I think the docker file from them should work so maybe I am doing the processs all wrong and there is another way to build "my own images". Thanks for any ideas.


Solution

  • I think the intent here is to use git to clone the Fabric GitHub repository, then in your local copy of the repository (using the appropriate branch for the version of Fabric you are trying to build), to run the make docker GO_TAGS=pkcs11 command. This target in the Fabric project's Makefile will build the Docker images.