File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 99 if [ -z ${GO_VERSION+x} ]; then \
1010 GO_VERSION=$(curl -sX GET https://golang.org/dl/ | grep -o '<span.*>.*linux-amd64.*</span>' | grep -oP '(?<=go).*(?=.linux)' ); \
1111 fi && \
12- mkdir -p /root-layer/usr/local && \
12+ mkdir -p /root-layer/golang && \
1313 curl -o \
14- /tmp /golang.tar.gz -L \
14+ /root-layer /golang/golang_x86_64 .tar.gz -L \
1515 https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
16- tar xzf /tmp/golang.tar.gz -C \
17- /root-layer/usr/local
16+ curl -o \
17+ /root-layer/golang/golang_armv7l.tar.gz -L \
18+ https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz && \
19+ curl -o \
20+ /root-layer/golang/golang_aarch64.tar.gz -L \
21+ https://dl.google.com/go/go${GO_VERSION}.linux-arm64.tar.gz
1822
1923COPY root/ /root-layer/
2024
Original file line number Diff line number Diff line change @@ -8,3 +8,12 @@ if grep -q '^PATH=' /etc/services.d/code-server/run; then
88else
99 sed -i '/^#!\/usr\/bin/a \\n# Added by codeserver-golang\nexport PATH=$PATH:/usr/local/go/bin' /etc/services.d/code-server/run
1010fi
11+
12+ ARCH=$(uname -m)
13+ if [ -f "/golang/golang_${ARCH}.tar.gz" ]; then
14+ echo "Installing golang"
15+ tar xzf "/golang/golang_${ARCH}.tar.gz" -C /usr/local
16+ rm -rf /golang
17+ else
18+ echo "Golang already installed, skipping"
19+ fi
You can’t perform that action at this time.
0 commit comments