Skip to content

Commit

Permalink
Re-add Go to fabric-tools image (#4176)
Browse files Browse the repository at this point in the history
Since the images are no longer based on the golang alpine images,
need to manually install go to the fabric-tools image.
go is needed for users that use fabric-tools image to package go chaincodes.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart authored Apr 20, 2023
1 parent 268a8a1 commit aaf9932
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions images/tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,20 @@ RUN make tools GO_TAGS=${GO_TAGS} FABRIC_VER=${FABRIC_VER}
ARG UBUNTU_VER
FROM ubuntu:${UBUNTU_VER}

ARG TARGETARCH
ARG TARGETOS
ARG FABRIC_VER
ARG GO_VER

RUN apt update && apt install -y \
bash \
curl \
jq \
tzdata

RUN curl -sL https://go.dev/dl/go${GO_VER}.${TARGETOS}-${TARGETARCH}.tar.gz | tar zxvf - -C /usr/local
ENV PATH="/usr/local/go/bin:$PATH"

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
Expand Down

0 comments on commit aaf9932

Please sign in to comment.