Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Thumbs.db

# Personal config files (use example files instead)
claude_mcp_proxy/claude_desktop_config.json
ssh/

# Runtime files
*.pid
Expand All @@ -64,5 +65,6 @@ jupyter_runtime/
# Node modules (if any)
node_modules/

third_party/

cleaup.sh
cleaup.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The filename in the ignore list contains a typo. It should be cleanup.sh to match the actual script name in the repository.

cleanup.sh

14 changes: 14 additions & 0 deletions Dockerfile.claude
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:22-bookworm-slim

WORKDIR /workspace

RUN apt-get update && apt-get install -y --no-install-recommends \
git \
openssh-client \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN npm install -g @anthropic-ai/claude-code \
&& npm cache clean --force

ENTRYPOINT ["claude"]
79 changes: 79 additions & 0 deletions Dockerfile.litebox-claude
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
FROM debian:bookworm-slim AS builder

RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
curl \
ca-certificates \
tar \
xz-utils \
&& rm -rf /var/lib/apt/lists/*

# Node.js (for Claude CLI packaging)
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get update && apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*

ENV NPM_CONFIG_PREFIX=/usr/local

RUN npm install -g @anthropic-ai/claude-code \
&& npm cache clean --force

RUN mkdir -p /opt/litebox

# Record the Claude package directory + entrypoint path
RUN set -e; \
NPM_ROOT="$(npm root -g)"; \
if [ -d "${NPM_ROOT}/claude-code" ]; then \
export CLAUDE_PKG_DIR="${NPM_ROOT}/claude-code"; \
elif [ -d "${NPM_ROOT}/@anthropic-ai/claude-code" ]; then \
export CLAUDE_PKG_DIR="${NPM_ROOT}/@anthropic-ai/claude-code"; \
else \
echo "Claude Code package not found under ${NPM_ROOT}" >&2; \
exit 1; \
fi; \
rm -rf /opt/litebox/claude-code; \
cp -a "${CLAUDE_PKG_DIR}" /opt/litebox/claude-code; \
export CLAUDE_ROOTFS_PKG_DIR="/usr/local/lib/node_modules/claude-code"; \
node - <<'NODE'
const fs = require('fs');
const path = require('path');

const srcDir = process.env.CLAUDE_PKG_DIR;
const rootfsDir = process.env.CLAUDE_ROOTFS_PKG_DIR;
if (!srcDir || !rootfsDir) {
throw new Error('Missing CLAUDE_PKG_DIR or CLAUDE_ROOTFS_PKG_DIR');
}
const pkg = require(path.join(srcDir, 'package.json'));
const binRel = pkg?.bin?.claude;
if (!binRel) {
throw new Error('Claude Code bin entry not found');
}
fs.writeFileSync('/opt/litebox/claude_pkg_dir.txt', '/opt/litebox/claude-code');
fs.writeFileSync('/opt/litebox/claude_entrypoint_path.txt', path.join(rootfsDir, binRel));
NODE

COPY scripts/litebox/build_rootfs.sh /tmp/build_rootfs.sh
RUN chmod +x /tmp/build_rootfs.sh \
&& CLAUDE_PKG_DIR="$(cat /opt/litebox/claude_pkg_dir.txt)" /tmp/build_rootfs.sh /opt/litebox/rootfs.tar

FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
ca-certificates \
tar \
&& rm -rf /var/lib/apt/lists/*

# Node binary is used as the program executed inside LiteBox (not executed on host)
COPY --from=builder /usr/bin/node /usr/bin/node
RUN mkdir -p /usr/local/lib/node_modules

COPY third_party/litebox-bin/litebox_runner_linux_userland /usr/local/bin/litebox_runner_linux_userland
COPY --from=builder /opt/litebox/claude-code /usr/local/lib/node_modules/claude-code
COPY --from=builder /opt/litebox/rootfs.tar /opt/litebox/rootfs.tar
COPY --from=builder /opt/litebox/claude_entrypoint_path.txt /opt/litebox/claude_entrypoint_path.txt

COPY scripts/litebox/entrypoint.sh /entrypoint.sh
RUN chmod +x /usr/local/bin/litebox_runner_linux_userland /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
Loading