openclaude Docker & Self-Hosted Deployment

GitHub

Runs anywhere. uses anything

30,636 stars TypeScript TypeScript 1 file ยท ~26,540 tokens #ai#ai-agent#ai-tools#cli#coding
1. Pull Image (DOCKERHUB) docker pull Gitlawb/openclaude:latest
2. Docker Run (1-Click Launch) docker run -d --name openclaude --restart always gitlawb/openclaude:latest
3. Podman Run podman run -d --name openclaude --restart always gitlawb/openclaude:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/gitlawb/openclaude:latest
5. ORAS Pull (OCI Artifact) oras pull gitlawb/openclaude:latest
Dockerfile
# ---- build stage ----
FROM node:22-slim AS build

WORKDIR /app

# Copy dependency manifests first for better layer caching
COPY package.json bun.lock .bun-version ./

# Install the Bun version tracked by the repo
RUN set -eu; \
    BUN_VERSION="$(tr -d '\r\n' < .bun-version)"; \
    printf '%s' "$BUN_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; \
    npm install -g "bun@$BUN_VERSION"

# Install all dependencies (including devDependencies for build)
RUN bun install --frozen-lockfile

# Copy source code
COPY src/ src/
COPY scripts/ scripts/
COPY bin/ bin/
COPY tsconfig.json ./

# Build the CLI bundle
RUN bun run build

# Prune devDependencies
RUN rm -rf node_modules && bun install --frozen-lockfile --production

# ---- runtime stage ----
FROM node:22-slim

WORKDIR /app

# Copy only what's needed to run
COPY --from=build /app/dist/cli.mjs dist/cli.mjs
COPY --from=build /app/bin/ bin/
COPY --from=build /app/node_modules/ node_modules/
COPY --from=build /app/package.json package.json
COPY README.md ./

# Install git and ripgrep โ€” many CLI tool operations depend on them
RUN apt-get update && apt-get install -y --no-install-recommends git ripgrep \
    && rm -rf /var/lib/apt/lists/*

# Run as non-root user
USER node

ENTRYPOINT ["node", "/app/bin/openclaude"]