Running Claude Code in a container
Step 1: create a dockerfile inside the folder of your project
# Use the official Node.js 18 LTS image as base
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Install Claude Code CLI globally
RUN npm install -g @anthropic-ai/claude-code
# Set the default command to start an interactive session
CMD ["claude"]Step 2: Build your image
docker build -t claude-code .Step 3: Run your container (with volume mounted in current directory so you can read/write files on your computer, as opposed to container file system)
docker run -it -v $(pwd):/app claude-codeStep 4: Login and you’re off to the races!


