返回 CodeWhale
Dockerfile.toolbox
根目录 / docs / examples / Dockerfile.toolbox
1 # syntax=docker/dockerfile:1
2 #
3 # Opt-in Codewhale toolbox image.
4 #
5 # The published ghcr.io/hmbown/codewhale:latest image intentionally stays
6 # minimal, non-root, and without passwordless sudo. Use this Dockerfile only for
7 # workspaces where you deliberately want package installation, custom CA setup,
8 # or project-specific build tools inside the container.
9 #
10 # Use the published GHCR base tag (`:latest` or a release tag). Build current main from the root
11 # Dockerfile when testing unreleased source.
12 #
13 # Example:
14 # docker build -f docs/examples/Dockerfile.toolbox \
15 # --build-arg CODEWHALE_IMAGE=ghcr.io/hmbown/codewhale:latest \
16 # --build-arg TOOLBOX_PACKAGES="git openssh-client curl build-essential pkg-config python3 python3-pip nodejs npm" \
17 # -t codewhale-toolbox:my-project .
18
19 ARG CODEWHALE_IMAGE=ghcr.io/hmbown/codewhale:latest
20 FROM ${CODEWHALE_IMAGE}
21
22 USER root
23
24 ARG TOOLBOX_PACKAGES="git openssh-client curl build-essential pkg-config python3 python3-pip nodejs npm"
25 RUN apt-get update \
26 && apt-get install -y --no-install-recommends sudo ${TOOLBOX_PACKAGES} \
27 && rm -rf /var/lib/apt/lists/* \
28 && printf '%s\n' 'codewhale ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/codewhale-nopasswd \
29 && chmod 0440 /etc/sudoers.d/codewhale-nopasswd
30
31 USER codewhale
32 WORKDIR /workspace
33
33 lines Plain Text