code-server-golang: multi arch

This commit is contained in:
aptalca
2020-05-18 17:05:13 -04:00
parent 260a0f01f6
commit a12d90ea84
2 changed files with 17 additions and 4 deletions
+8 -4
View File
@@ -9,12 +9,16 @@ RUN \
if [ -z ${GO_VERSION+x} ]; then \
GO_VERSION=$(curl -sX GET https://golang.org/dl/ | grep -o '<span.*>.*linux-amd64.*</span>' | grep -oP '(?<=go).*(?=.linux)'); \
fi && \
mkdir -p /root-layer/usr/local && \
mkdir -p /root-layer/golang && \
curl -o \
/tmp/golang.tar.gz -L \
/root-layer/golang/golang_x86_64.tar.gz -L \
https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
tar xzf /tmp/golang.tar.gz -C \
/root-layer/usr/local
curl -o \
/root-layer/golang/golang_armv7l.tar.gz -L \
https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz && \
curl -o \
/root-layer/golang/golang_aarch64.tar.gz -L \
https://dl.google.com/go/go${GO_VERSION}.linux-arm64.tar.gz
COPY root/ /root-layer/
+9
View File
@@ -8,3 +8,12 @@ if grep -q '^PATH=' /etc/services.d/code-server/run; then
else
sed -i '/^#!\/usr\/bin/a \\n# Added by codeserver-golang\nexport PATH=$PATH:/usr/local/go/bin' /etc/services.d/code-server/run
fi
ARCH=$(uname -m)
if [ -f "/golang/golang_${ARCH}.tar.gz" ]; then
echo "Installing golang"
tar xzf "/golang/golang_${ARCH}.tar.gz" -C /usr/local
rm -rf /golang
else
echo "Golang already installed, skipping"
fi