sandboxbox 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile CHANGED
@@ -1,39 +1,95 @@
1
- FROM ubuntu:24.04
1
+ FROM node:20
2
2
 
3
- # Set up code user
4
- RUN useradd code
3
+ ARG TZ
4
+ ENV TZ="$TZ"
5
5
 
6
- RUN chsh -s /bin/bash code
6
+ ARG CLAUDE_CODE_VERSION=latest
7
7
 
8
- RUN mkdir /home/code
9
- RUN chown code:code /home/code
8
+ # Install basic development tools and iptables/ipset
9
+ RUN 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
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
10
29
 
11
- # Install deps
30
+ # Ensure default node user has access to /usr/local/share
31
+ RUN mkdir -p /usr/local/share/npm-global && \
32
+ chown -R node:node /usr/local/share
12
33
 
13
- ENV USE_BUILTIN_RIPGREP=0
14
- RUN apt-get update && apt-get install -y \
15
- postgresql-client nodejs npm curl sudo neovim direnv supervisor
34
+ ARG USERNAME=node
16
35
 
17
- # Install playwright deps
18
- RUN npx --yes playwright install-deps
36
+ # Persist bash history.
37
+ RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
38
+ && mkdir -p /commandhistory \
39
+ && touch /commandhistory/.bash_history \
40
+ && chown -R $USERNAME /commandhistory
19
41
 
20
- RUN npm i -g @playwright/mcp
42
+ # Set `DEVCONTAINER` environment variable to help with orientation
43
+ ENV DEVCONTAINER=true
44
+
45
+ # Create workspace and config directories and set permissions
46
+ RUN mkdir -p /workspace /home/node/.claude && \
47
+ chown -R node:node /workspace /home/node/.claude
48
+
49
+ WORKDIR /workspace
21
50
 
22
- # Install pnpm and configure it to be global
51
+ ARG GIT_DELTA_VERSION=0.18.2
52
+ RUN ARCH=$(dpkg --print-architecture) && \
53
+ wget "https://github.com/dandavison/delta/releases/download/${GIT_DELTA_VERSION}/git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
54
+ sudo dpkg -i "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
55
+ rm "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb"
23
56
 
24
- RUN npm i -g pnpm
57
+ # Set up non-root user
58
+ USER node
25
59
 
26
- RUN mkdir -p /usr/local/share/pnpm/global/bin
60
+ # Install global packages
61
+ ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
62
+ ENV PATH=$PATH:/usr/local/share/npm-global/bin
27
63
 
28
- RUN pnpm config set global-bin-dir /usr/local/share/pnpm/global/bin
29
- RUN pnpm config set global-dir /usr/local/share/pnpm
30
- RUN echo 'export PATH="/usr/local/share/pnpm/global/bin:$PATH"' | tee -a /etc/bash.bashrc
64
+ # Set the default shell to zsh rather than sh
65
+ ENV SHELL=/bin/zsh
31
66
 
32
- RUN bash -c 'PATH="/usr/local/share/pnpm/global/bin:$PATH" && pnpm i -g @anthropic-ai/claude-code'
67
+ # Set the default editor and visual
68
+ ENV EDITOR=nano
69
+ ENV VISUAL=nano
33
70
 
34
- USER code
71
+ # Default powerline10k theme
72
+ ARG ZSH_IN_DOCKER_VERSION=1.2.0
73
+ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
74
+ -p git \
75
+ -p fzf \
76
+ -a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \
77
+ -a "source /usr/share/doc/fzf/examples/completion.zsh" \
78
+ -a "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
79
+ -x
35
80
 
36
- # Install chromium. Has to be done using the playwright MCP version for proper pathing etc
37
- RUN node /usr/local/lib/node_modules/@playwright/mcp/node_modules/playwright/cli.js install chromium
81
+ # Install Claude
82
+ RUN npm install -g @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}
83
+
84
+ # Install playwright deps
85
+ RUN npx --yes playwright install-deps
86
+
87
+ RUN npm i -g @playwright/mcp
38
88
 
39
- CMD ["/bin/bash"]
89
+ # Copy and set up firewall script
90
+ COPY init-firewall.sh /usr/local/bin/
91
+ USER root
92
+ RUN chmod +x /usr/local/bin/init-firewall.sh && \
93
+ echo "node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh" > /etc/sudoers.d/node-firewall && \
94
+ chmod 0440 /etc/sudoers.d/node-firewall
95
+ USER node
@@ -0,0 +1,16 @@
1
+ FROM ubuntu:24.04
2
+
3
+ # Set environment variables
4
+ ENV NODE_ENV=production
5
+ ENV APP_DIR=/app
6
+
7
+ # Create a simple test directory
8
+ WORKDIR /app
9
+
10
+ # Simple commands that don't require root
11
+ RUN echo "Building container..."
12
+ RUN echo "Node environment: $NODE_ENV"
13
+ RUN mkdir -p data logs
14
+
15
+ # Default command
16
+ CMD ["/bin/bash"]
package/bin/bwrap ADDED
Binary file