From aaf9932bd0176eefaac7809d048c45af2ffbc5c8 Mon Sep 17 00:00:00 2001 From: Dave Enyeart Date: Thu, 20 Apr 2023 04:26:03 -0400 Subject: [PATCH] Re-add Go to fabric-tools image (#4176) 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 --- images/tools/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/images/tools/Dockerfile b/images/tools/Dockerfile index fe9ea37a34e..8afa0352cff 100644 --- a/images/tools/Dockerfile +++ b/images/tools/Dockerfile @@ -50,7 +50,10 @@ 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 \ @@ -58,6 +61,9 @@ RUN apt update && apt install -y \ 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