Created
July 9, 2026 08:49
-
-
Save ChieftainY2k/c5382702070c763c11c17b7086ee2e7e to your computer and use it in GitHub Desktop.
Claude in docker container (handy as a bash function)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| claude-docker() { | |
| docker image inspect claude-code-slim >/dev/null 2>&1 || docker build -t claude-code-slim -<<'EOF' || return 1 | |
| FROM debian:bookworm-slim | |
| RUN apt-get update && apt-get install -y curl ca-certificates git && rm -rf /var/lib/apt/lists/* | |
| RUN useradd -m claude | |
| USER claude | |
| ENV HOME=/home/claude | |
| RUN curl -fsSL https://claude.ai/install.sh | bash | |
| ENTRYPOINT ["/home/claude/.local/bin/claude"] | |
| EOF | |
| docker run --rm -it \ | |
| -u "$(id -u):$(id -g)" \ | |
| -e HOME=/home/claude \ | |
| -v "$PWD:$PWD" \ | |
| -v claude-home:/home/claude/.claude \ | |
| -v claude-local:/home/claude/.local \ | |
| -w "$PWD" \ | |
| claude-code-slim | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment