Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save briangershon/a6337de77a00ee54badabcfa4ef6b25b to your computer and use it in GitHub Desktop.

Select an option

Save briangershon/a6337de77a00ee54badabcfa4ef6b25b to your computer and use it in GitHub Desktop.
Install Go in a Dockerfile
# Install latest Go (system-wide, all users)
ARG TARGETARCH
RUN set -eux; \
GOVERSION=$(curl -fsSL "https://go.dev/VERSION?m=text" | head -1); \
curl -fsSL "https://go.dev/dl/${GOVERSION}.linux-${TARGETARCH}.tar.gz" \
| tar -C /usr/local -xz
ENV GOPATH=/home/agent/go
ENV PATH="/usr/local/go/bin:${GOPATH}/bin:${PATH}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment