返回 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 # Example:
11 # docker build -f docs/examples/Dockerfile.toolbox \
12 # --build-arg CODEWHALE_IMAGE=ghcr.io/hmbown/codewhale:vX.Y.Z \
13 # --build-arg TOOLBOX_PACKAGES="git openssh-client curl build-essential pkg-config python3 python3-pip nodejs npm" \
14 # -t codewhale-toolbox:my-project .
15
16 ARG CODEWHALE_IMAGE=ghcr.io/hmbown/codewhale:latest
17 FROM ${CODEWHALE_IMAGE}
18
19 USER root
20
21 ARG TOOLBOX_PACKAGES="git openssh-client curl build-essential pkg-config python3 python3-pip nodejs npm"
22 RUN apt-get update \
23 && apt-get install -y --no-install-recommends sudo ${TOOLBOX_PACKAGES} \
24 && rm -rf /var/lib/apt/lists/* \
25 && printf '%s\n' 'codewhale ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/codewhale-nopasswd \
26 && chmod 0440 /etc/sudoers.d/codewhale-nopasswd
27
28 USER codewhale
29 WORKDIR /workspace
30
30 lines Plain Text