fix: ensure we install the golang for the correct architecture
TARGETARCH is an automatic build-arg that docker injects - https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope - so this is safe to depend on.
This commit is contained in:
1 parent
a3ca2a56b8
commit
dfcce1c6a6
1 file changed
+3
-2
@@ -7,8 +7,9 @@ RUN apt-get install --no-install-recommends -y build-essential file nano && \
|
|||||||
apt-get autoremove --yes && \
|
apt-get autoremove --yes && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN wget https://dl.google.com/go/go1.17.9.linux-amd64.tar.gz && \
|
ARG TARGETARCH
|
||||||
tar -xvf go1.17.9.linux-amd64.tar.gz && \
|
RUN wget https://dl.google.com/go/go1.17.9.linux-${TARGETARCH}.tar.gz && \
|
||||||
|
tar -xvf go1.17.9.linux-${TARGETARCH}.tar.gz && \
|
||||||
mv go /usr/local
|
mv go /usr/local
|
||||||
|
|
||||||
RUN GOROOT=/usr/local/go /usr/local/go/bin/go install golang.org/x/tools/gopls@latest 2>&1
|
RUN GOROOT=/usr/local/go /usr/local/go/bin/go install golang.org/x/tools/gopls@latest 2>&1
|
||||||
|
|||||||
Reference in new issue
Block a user