File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ // Shared Dockerfile partials live in ports/_common/*.dockerfile and are raw
3+ // Dockerfile content (plus a few Go-template directives), so highlight them
4+ // as Dockerfiles even though VS Code does not associate the extension by default.
5+ "files.associations" : {
6+ "*.dockerfile" : " dockerfile"
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2+ --mount=type=cache,target=/var/lib/apt,sharing=locked \
3+ rm -f /etc/apt/apt.conf.d/docker-clean \
4+ && export DEBIAN_FRONTEND=noninteractive \
5+ && apt-get update \
6+ && apt-get install -y --no-install-recommends \
7+ apt-transport-https \
8+ bash \
9+ bash-completion \
10+ build-essential \
11+ ca-certificates \
12+ curl \
13+ dirmngr \
14+ eza \
15+ fd-find \
16+ git \
17+ git-lfs \
18+ gnupg2 \
19+ htop \
20+ init-system-helpers \
21+ iproute2 \
22+ jq \
23+ less \
24+ libc6 \
25+ libgcc1 \
26+ libgssapi-krb5-2 \
27+ libicu[0-9][0-9] \
28+ libkrb5-3 \
29+ libstdc++6 \
30+ locales \
31+ lsb-release \
32+ lsof \
33+ make \
34+ man-db \
35+ manpages \
36+ manpages-dev \
37+ ncdu \
38+ openssh-client \
39+ procps \
40+ psmisc \
41+ {{- if .SystemPython }}
42+ python3 \
43+ python3-pip \
44+ {{- end }}
45+ ripgrep \
46+ rsync \
47+ strace \
48+ sudo \
49+ tmux \
50+ tzdata \
51+ unzip \
52+ vim \
53+ wget \
54+ zip \
55+ zlib1g \
56+ zsh \
57+ && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
58+ && locale-gen
Original file line number Diff line number Diff line change 1+ USER root
2+ WORKDIR /
3+
4+ # Mount point for a persisted command-history volume. Created with USERNAME
5+ # ownership so a fresh named volume inherits it on first mount.
6+ RUN install -d -o "${USERNAME}" -g "${USERNAME}" /commandhistory
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2+ --mount=type=cache,target=/var/lib/apt,sharing=locked \
3+ curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
4+ && apt-get install -y --no-install-recommends \
5+ nodejs
Original file line number Diff line number Diff line change 1+ RUN git clone --depth 1 https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh \
2+ && git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
3+ && git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
4+ && git clone --depth 1 https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
5+
6+ # .zshrc is inlined here (single source of truth across ports). Persists command
7+ # history across rebuilds via the /commandhistory volume (see docker-compose.yaml).
8+ COPY --chown=${USERNAME}:${USERNAME} <<"EOF" /home/${USERNAME}/.zshrc
9+ export ZSH="$HOME/.oh-my-zsh"
10+
11+ ZSH_THEME="refined"
12+
13+ plugins=(
14+ git
15+ zsh-autosuggestions
16+ zsh-syntax-highlighting
17+ )
18+
19+ fpath+=("${ZSH_CUSTOM:-$ZSH/custom}/plugins/zsh-completions/src" )
20+
21+ source "$ZSH/oh-my-zsh.sh"
22+
23+ HISTFILE=/commandhistory/.zsh_history
24+ HISTSIZE=100000
25+ SAVEHIST=100000
26+ setopt INC_APPEND_HISTORY
27+ setopt SHARE_HISTORY
28+ setopt HIST_IGNORE_DUPS
29+ EOF
Original file line number Diff line number Diff line change 1+ ARG USERNAME=hypnos
2+ ARG USER_UID=1000
3+ ARG USER_GID=1000
4+ RUN groupadd "${USERNAME}" --gid ${USER_GID} \
5+ && useradd --create-home "${USERNAME}" --shell /usr/bin/zsh --uid "${USER_UID}" --gid "${USER_GID}" \
6+ && echo "${USERNAME}:${USERNAME}" | chpasswd \
7+ && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/${USERNAME}"
8+
9+ USER ${USERNAME}
10+ WORKDIR /home/${USERNAME}
Original file line number Diff line number Diff line change 11ARG BASE= docker.io /library/golang
22FROM $ {BASE}
33
4- {{ template " apt" dict " SystemPython" true }}
4+ {{ template " apt.dockerfile " dict " SystemPython" true }}
55
6- {{ template " node" . }}
6+ {{ template " node.dockerfile " . }}
77
8- {{ template " user" . }}
8+ {{ template " user.dockerfile " . }}
99
1010RUN mkdir -p ~/.cache /go-build
1111
12- {{ template " shell" . }}
12+ {{ template " shell.dockerfile " . }}
1313
14- {{ template " commandhistory" . }}
14+ {{ template " commandhistory.dockerfile " . }}
1515
1616RUN mkdir -p /go/pkg/mod /go/bin \
1717 && chown -R " ${USERNAME}:${USERNAME}" /go
Original file line number Diff line number Diff line change @@ -110,14 +110,14 @@ EOF
110110
111111# Node developer tooling, installed globally into a per-user npm prefix so it
112112# lands under the dev user's home (no root-owned /usr/local writes) and stays on
113- # PATH. corepack ships with node and provides the pnpm/yarn shims.
113+ # PATH. corepack is installed explicitly (recent node images no longer bundle it)
114+ # and provides the pnpm/yarn shims.
114115ENV NPM_CONFIG_PREFIX=/home/${USERNAME}/.local
115116ENV PATH=/home/${USERNAME}/.local/bin:${PATH}
116117RUN npm install -g \
118+ corepack \
117119 typescript \
118120 ts-node \
119- eslint \
120- prettier \
121121 npm-check-updates \
122122 && corepack enable --install-directory /home/${USERNAME}/.local/bin
123123
Original file line number Diff line number Diff line change 11ARG BASE= docker.io /library/node
22FROM $ {BASE}
33
4- {{ template " apt" dict " SystemPython" true }}
4+ {{ template " apt.dockerfile " dict " SystemPython" true }}
55
66# The official node image ships a ` node` user at UID/GID 1000, which collides
77# with the dev user the shared " user" partial creates at 1000:1000. Remove it
88# (and its home) so that partial can claim those IDs.
99RUN userdel --remove node 2>/dev/null || true \
1010 && groupdel node 2>/dev/null || true
1111
12- {{ template " user" . }}
12+ {{ template " user.dockerfile " . }}
1313
14- {{ template " shell" . }}
14+ {{ template " shell.dockerfile " . }}
1515
1616# Node developer tooling, installed globally into a per-user npm prefix so it
1717# lands under the dev user's home (no root-owned /usr/local writes) and stays on
18- # PATH. corepack ships with node and provides the pnpm/yarn shims.
18+ # PATH. corepack is installed explicitly (recent node images no longer bundle it)
19+ # and provides the pnpm/yarn shims.
1920ENV NPM_CONFIG_PREFIX= /home/$ {USERNAME}/.local
2021ENV PATH= /home/$ {USERNAME}/.local /bin:$ {PATH}
2122RUN npm install -g \
23+ corepack \
2224 typescript \
2325 ts-node \
2426 npm-check-updates \
2527 && corepack enable --install-directory /home/$ {USERNAME}/.local /bin
2628
27- {{ template " commandhistory" . }}
29+ {{ template " commandhistory.dockerfile " . }}
You can’t perform that action at this time.
0 commit comments