My agentic slop goes here. Not intended for anyone else!
1FROM node:20
2
3ARG TZ
4ENV TZ="$TZ"
5
6ARG CLAUDE_CODE_VERSION=latest
7
8# Install basic development tools and iptables/ipset
9RUN apt-get update && apt-get install -y --no-install-recommends \
10 less \
11 git \
12 procps \
13 sudo \
14 fzf \
15 zsh \
16 man-db \
17 unzip \
18 gnupg2 \
19 gh \
20 iptables \
21 ipset \
22 iproute2 \
23 dnsutils \
24 aggregate \
25 jq \
26 nano \
27 vim \
28 locales \
29 && apt-get clean && rm -rf /var/lib/apt/lists/*
30
31# Configure locales
32RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
33 locale-gen
34ENV LANG en_US.UTF-8
35ENV LANGUAGE en_US:en
36ENV LC_ALL en_US.UTF-8
37
38# Parquet
39RUN wget https://packages.apache.org/artifactory/arrow/debian/apache-arrow-apt-source-latest-bookworm.deb && apt install -y -V ./apache-arrow-apt-source-latest-bookworm.deb && rm -f ./apache-arrow-apt-source-latest-bookworm.deb
40RUN apt update
41RUN apt install -y libarrow-dev libparquet-dev
42
43# Ensure default node user has access to /usr/local/share
44RUN mkdir -p /usr/local/share/npm-global && \
45 chown -R node:node /usr/local/share
46
47ARG USERNAME=node
48
49# Persist bash history.
50RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
51 && mkdir /commandhistory \
52 && touch /commandhistory/.bash_history \
53 && chown -R $USERNAME /commandhistory
54
55# Set `DEVCONTAINER` environment variable to help with orientation
56ENV DEVCONTAINER=true
57
58# Create workspace and config directories and set permissions
59RUN mkdir -p /workspace /home/node/.claude && \
60 chown -R node:node /workspace /home/node/.claude
61
62WORKDIR /workspace
63
64ARG GIT_DELTA_VERSION=0.18.2
65RUN ARCH=$(dpkg --print-architecture) && \
66 wget "https://github.com/dandavison/delta/releases/download/${GIT_DELTA_VERSION}/git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
67 sudo dpkg -i "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
68 rm "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb"
69
70# Set up non-root user
71USER node
72
73# Install global packages
74ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
75ENV PATH=$PATH:/usr/local/share/npm-global/bin
76
77# Set the default shell to zsh rather than sh
78ENV SHELL=/bin/zsh
79
80# Set the default editor and visual
81ENV EDITOR nano
82ENV VISUAL nano
83
84# Default powerline10k theme
85ARG ZSH_IN_DOCKER_VERSION=1.2.0
86RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
87 -p git \
88 -p fzf \
89 -a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \
90 -a "source /usr/share/doc/fzf/examples/completion.zsh" \
91 -a "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
92 -x
93
94# Install Claude
95RUN npm install -g @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}
96
97COPY setup-ocaml.sh /usr/local/bin
98
99# Copy and set up firewall script and let node sudo to all (for opam depexts)
100COPY init-firewall.sh /usr/local/bin/
101USER root
102RUN chmod +x /usr/local/bin/init-firewall.sh && \
103 echo "node ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/node-firewall && \
104 chmod 0440 /etc/sudoers.d/node-firewall
105USER node
106