Skip to content

Commit c6219f3

Browse files
committed
fix(rdesktop-ubuntu-kde): Update Go toolchain installation process
- Dockerfile: Enhance Go installation with architecture detection and checksum verification - Dockerfile: Clean up temporary files after installation run-ci
1 parent 2d74635 commit c6219f3

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

rdesktop-ubuntu-kde/Dockerfile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ ARG DEBIAN_FRONTEND=noninteractive
77
# Persisted tool installs (avoid /config, which is a mount in LinuxServer images)
88
ENV \
99
FNM_DIR=/opt/fnm \
10-
UV_INSTALL_DIR=/opt/uv
10+
UV_INSTALL_DIR=/opt/uv \
11+
GO_HOME=/opt/go
1112

1213
# Copy application files and s6-overlay config to container root.
1314
COPY root/ /
@@ -64,6 +65,27 @@ RUN DOCKER_TMP_DIR="/tmp/.docker" && \
6465
&& \
6566
update-alternatives --set awk /usr/bin/gawk && \
6667
\
68+
# Install the latest stable Go toolchain into /opt/go
69+
# Follow code-server pattern: fetch JSON, pick latest stable, verify checksum, extract, clean
70+
ARCH=$(uname -m) && \
71+
case "$ARCH" in \
72+
x86_64) ARCH=amd64 ;; \
73+
aarch64|arm64) ARCH=arm64 ;; \
74+
*) echo "Unsupported arch: $ARCH" >&2; exit 1 ;; \
75+
esac && \
76+
GO_JSON="$(curl -sSfL 'https://go.dev/dl/?mode=json')" && \
77+
GO_VERSION="$(echo "$GO_JSON" | jq -r '[.[] | select(.stable)][0].version')" && \
78+
TARBALL="${GO_VERSION}.linux-${ARCH}.tar.gz" && \
79+
GO_SHA256="$(echo "$GO_JSON" | jq -r --arg GO_VERSION "$GO_VERSION" --arg TARBALL "$TARBALL" '.[] | select(.version == $GO_VERSION) | .files[] | select(.filename == $TARBALL) | .sha256')" && \
80+
echo "Installing ${GO_VERSION} for ${ARCH}" && \
81+
curl -sSfL -o /tmp/go.tgz "https://go.dev/dl/${TARBALL}" && \
82+
echo "${GO_SHA256} /tmp/go.tgz" | sha256sum -c - && \
83+
tar -C /opt -xzf /tmp/go.tgz && \
84+
ln -sf "$GO_HOME/bin/go" /usr/local/bin/go && \
85+
ln -sf "$GO_HOME/bin/gofmt" /usr/local/bin/gofmt && \
86+
rm -rf /tmp/go.tgz && \
87+
$GO_HOME/bin/go version && \
88+
\
6789
# Install uv into a persisted location and symlink into /usr/local/bin
6890
mkdir -p "${UV_INSTALL_DIR}" && \
6991
curl -LsSf https://astral.sh/uv/install.sh | sh && \

0 commit comments

Comments
 (0)