Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go version for Docker file carlosedp/golang to 1.23.6 #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions Dockerfiles/Dockerfile.golang
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# Run with
# VER=1.19.2 bash -c 'docker buildx build -t carlosedp/golang:$VER -t carlosedp/golang:"$(echo $VER |cut -d. -f1-2)" --build-arg=VERSION=$VER --platform linux/amd64,linux/arm64,linux/ppc64le,linux/riscv64,linux/arm --push -f Dockerfile.golang .'
# VER=1.23.6 bash -c 'docker buildx build -t carlosedp/golang:$VER -t carlosedp/golang:"$(echo $VER |cut -d. -f1-2)" --build-arg=VERSION=$VER --platform linux/amd64,linux/arm64,linux/ppc64le,linux/riscv64,linux/arm --push -f Dockerfile.golang .'

FROM debian:sid-slim
ARG VERSION
ARG TARGETARCH

ENV GOLANG_VERSION $VERSION
ENV GOLANG_VERSION=${VERSION}

RUN apt-get update && apt-get install -y ca-certificates curl libc6 --no-install-recommends && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /usr/local && \
set -eux; \
if [ "$TARGETARCH" = "riscv64" ]; then \
URL="https://github.com/carlosedp/riscv-bringup/releases/download/v1.0"; \
else \
URL="https://golang.org/dl"; \
fi && \
URL="https://go.dev/dl"; \
if [ "$TARGETARCH" = "arm" ]; then export TARGETARCH=armv6l; fi && \
curl -L $URL/go${GOLANG_VERSION}.linux-$TARGETARCH.tar.gz --output go${GOLANG_VERSION}.tar.gz && \
tar vxf go${GOLANG_VERSION}.tar.gz -C /usr/local/ && \
Expand All @@ -24,8 +20,8 @@ RUN mkdir -p /usr/local && \
RUN export PATH="/usr/local/go/bin:$PATH"; \
/usr/local/go/bin/go version

ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
ENV GOPATH=/go
ENV PATH=${GOPATH}/bin:/usr/local/go/bin:${PATH}

RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH