Created
March 1, 2026 23:26
-
-
Save briangershon/a6337de77a00ee54badabcfa4ef6b25b to your computer and use it in GitHub Desktop.
Install Go in a Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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