Skip to content

Commit ad9fa38

Browse files
committed
gateway: extract go version from go mod and install
1 parent 9612e9f commit ad9fa38

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

projects/gateway/Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@
1616

1717
FROM gcr.io/oss-fuzz-base/base-builder-go
1818

19-
RUN wget https://go.dev/dl/go1.25.3.linux-amd64.tar.gz \
20-
&& mkdir temp-go \
21-
&& rm -rf /root/.go/* \
22-
&& tar -C temp-go/ -xzf go1.25.3.linux-amd64.tar.gz \
23-
&& mv temp-go/go/* /root/.go/ \
24-
&& rm -rf temp-go go1.25.3.linux-amd64.tar.gz \
25-
&& apt-get update \
19+
RUN apt-get update \
2620
&& apt-get install -y btrfs-progs libbtrfs-dev
2721

2822
RUN git clone --depth 1 https://github.com/envoyproxy/gateway.git
2923

24+
RUN cd $SRC/gateway && \
25+
GO_VERSION=$(grep -oP '^go \K[0-9]+\.[0-9]+(\.[0-9]+)?' go.mod | head -1) && \
26+
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
27+
mkdir temp-go && \
28+
rm -rf /root/.go/* && \
29+
tar -C temp-go/ -xzf go${GO_VERSION}.linux-amd64.tar.gz && \
30+
mv temp-go/go/* /root/.go/ && \
31+
rm -rf temp-go go${GO_VERSION}.linux-amd64.tar.gz
32+
3033
COPY build.sh $SRC/

0 commit comments

Comments
 (0)