feat(code-server): install Docker CLI and gh from vendor apt repos

- Install the Docker CLI with its Compose and Buildx plugins, and the GitHub
  CLI, from Docker's and GitHub's signed apt repositories; drop their home
  installs and the GitLab CLI from the README.
- Select the shell with SHELL and the start folder with DEFAULT_WORKSPACE
  instead of chsh and working_dir.
- Add an optional CODE_SERVER_APP_NAME.
- Document installing Java with SDKMAN.
This commit is contained in:
tiennm99 committed 2026-10-06 13:39:31 +07:00
1 parent 03a2016f23
commit c1ef9e7680
5 files changed
+84 -58

No files matched your search

+24 -3
View File
@@ -9,13 +9,34 @@ RUN apt-get update \
libffi-dev libssl-dev libyaml-dev zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# zsh as the container user's login shell.
RUN chsh -s /usr/bin/zsh coder
# Docker CLI with the Compose and Buildx plugins, from Docker's apt repository,
# and GitHub CLI, from GitHub's apt repository.
RUN install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg \
-o /etc/apt/keyrings/docker.asc \
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
-o /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& chmod a+r /etc/apt/keyrings/docker.asc /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& printf '%s\n' \
'Types: deb' \
'URIs: https://download.docker.com/linux/debian' \
"Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")" \
'Components: stable' \
"Architectures: $(dpkg --print-architecture)" \
'Signed-By: /etc/apt/keyrings/docker.asc' \
> /etc/apt/sources.list.d/docker.sources \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
> /etc/apt/sources.list.d/github-cli.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
docker-ce-cli docker-buildx-plugin docker-compose-plugin gh \
&& rm -rf /var/lib/apt/lists/*
# Workspace directory, owned by the container user.
RUN mkdir -p /workspace && chown 1000:1000 /workspace
# Startup wrapper: joins the Docker socket's group, then runs the image's entrypoint.
# Startup wrapper: enters DEFAULT_WORKSPACE, joins the Docker socket's group,
# then runs the image's entrypoint.
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
USER 1000