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:
Jose Diaz-Gonzalez
2022-10-12 21:51:52 -04:00
parent a3ca2a56b8
commit dfcce1c6a6

View File

@@ -7,8 +7,9 @@ RUN apt-get install --no-install-recommends -y build-essential file nano && \
apt-get autoremove --yes && \
rm -rf /var/lib/apt/lists/*
RUN wget https://dl.google.com/go/go1.17.9.linux-amd64.tar.gz && \
tar -xvf go1.17.9.linux-amd64.tar.gz && \
ARG TARGETARCH
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
RUN GOROOT=/usr/local/go /usr/local/go/bin/go install golang.org/x/tools/gopls@latest 2>&1