Skip to content

Commit eaa765f

Browse files
committed
dockerfile: Fix go downloading
Previous method doesnt support newer versions anymore (or not at least atm). Just use wget instead. Signed-off-by: Or Shoval <[email protected]>
1 parent c7d6d05 commit eaa765f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

cmd/Dockerfile

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ RUN mkdir /workdir
44
WORKDIR /workdir
55

66
COPY go.mod .
7-
RUN dnf install -y golang-$(sed -En 's/^go +(.*+)$/\1/p' go.mod).*
7+
8+
RUN dnf install -y wget
9+
10+
RUN GO_VERSION=$(sed -En 's/^go +(.*)$/\1/p' go.mod) && \
11+
wget https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
12+
tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && \
13+
rm go${GO_VERSION}.linux-amd64.tar.gz
14+
15+
ENV PATH /usr/local/go/bin:$PATH
816

917
COPY . .
1018

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ replace (
8787
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.1
8888
)
8989

90-
go 1.21
90+
go 1.21.0

0 commit comments

Comments
 (0)