轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥8起我的订单
文档
工具
提交工单页面收录
claude-code

n8500x/claude-code

n8500x

Claude Code on-prem: OpenAI/Anthropic gateways (API key, no-auth or OIDC) + Bedrock.

下载次数: 0状态:社区镜像维护者:n8500x仓库类型:镜像最近更新:15 小时前
让 AI 帮你使用轩辕镜像? · 展开查看说明 · 点击收起说明

如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

镜像简介
下载命令
镜像标签列表与下载命令
轩辕镜像,快一点,稳很多。
点击查看

claude-code (Bedrock)

The https://docs.anthropic.com/en/docs/claude-code agentic CLI, containerized to run against AWS Bedrock — either directly (SigV4) or through an on-prem gateway that fronts Bedrock with OAuth2 auth. Ships with a Java + Python build toolchain and an autonomous agentic-loop mode.

The docs are baked into the image. Run docker run --rm n8500x/claude-code help for a cheat sheet, or docs for this full document — no credentials needed.

Jump to: Quick reference · Gateway auth (SSO) · Air-gapped · Jenkins · Troubleshooting

Overview

Anthropic's official @anthropic-ai/claude-code CLI in a slim Node runtime. Defaults to Bedrock (CLAUDE_CODE_USE_BEDROCK=1); set gateway vars to use your on-prem gateway instead (Anthropic- or OpenAI-shaped). Entrypoint launches the TUI in /workspace; -p "..." for headless, loop for autonomous. Telemetry/updater off by default — suits air-gapped networks.

Quick reference

The image is self-documenting — help (cheat sheet) and docs (this file) run with no credentials:

bash
docker run --rm n8500x/claude-code help
docker run --rm n8500x/claude-code docs
I want to…Command
Interactive session (Bedrock)docker run --rm -it -e AWS_REGION=us-east-1 -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -v "$PWD:/workspace" n8500x/claude-code
One-shot prompt… n8500x/claude-code -p "explain this repo"
Autonomous loop… n8500x/claude-code loop "make ./gradlew test pass"
Use JDK 17add -e JAVA_HOME=/opt/java-17
No permission promptsadd -e CLAUDE_YOLO=1
Via on-prem gateway (SSO)set -e CLAUDE_GATEWAY_URL=… -e OIDC_ISSUER_URL=… -e OIDC_REALM=… -e GATEWAY_CLIENT_ID=… -e GATEWAY_CLIENT_SECRET=…
Show the cheat sheet / full docs… n8500x/claude-code help / docs

Podman works too — it's a drop-in for docker; use podman run … in place of docker run … in every example below.

Clone a private repo over SSH (and use its skills)

Inject an SSH key and optionally auto-clone a repo into /workspace — to pull code to review and pick up the repo's Claude skills (.claude/skills/, auto-discovered):

bash
docker run --rm \
  -e GIT_SSH_KEY_FILE=/keys/id -v ~/.ssh/id_ed25519:/keys/id:ro \
  -e CLONE_REPO='git@github.com:org/repo.git' \
  -v "$PWD:/workspace" [AUTH ENV…] \
  n8500x/claude-code -p "review this repo"

Key via GIT_SSH_KEY (raw), GIT_SSH_KEY_B64, or GIT_SSH_KEY_FILE; host keys via GIT_SSH_KNOWN_HOSTS[_FILE] / GIT_SSH_STRICT (default accept-new). Clone lands in /workspace (or CLONE_DIR), the entrypoint cds in so the repo's .claude/skills/ are active; CLONE_REF/CLONE_DEPTH set branch/shallow.

Quick start

docker pull n8500x/claude-code, then copy a complete command from Recipes. Interactive TUI needs -it; -p "…" runs headless; add -e AWS_PROFILE=… -v "$HOME/.aws:/home/claude/.aws:ro" for a named AWS profile.

Autonomous agentic loop

The loop subcommand runs Claude Code autonomously — headless, permissions bypassed — re-engaging the same session each iteration until the goal is verified done or a cap is hit. No TTY needed, so it suits CI / batch use. Same env as above (Bedrock or gateway), plus:

bash
docker run --rm -v "$PWD:/workspace" [AUTH ENV…] \
  n8500x/claude-code loop "make ./gradlew test pass"

The task can also come from -e CLAUDE_TASK="..." or a /workspace/TASK.md file. CLAUDE_LOOP=1 turns any invocation into a loop.

How it stops. Each iteration runs claude -p --output-format json --dangerously-skip-permissions resuming a fixed session id, so context carries over. An appended system prompt makes it emit CLAUDE_TASK_COMPLETE only when verified done. Ends on: sentinel (0), CLAUDE_LOOP_MAX_ITERS (4), budget (3), errors (1), or /workspace/.claude-stop. JSON logs in /workspace/.claude-loop/. It edits unattended — only use repos you trust.

What's inside

  • Base image: node:20-slim (Node.js 20; Claude Code needs Node 18+).
  • Agent: @anthropic-ai/claude-code via npm (CLAUDE_CODE_VERSION, pinned 2.1.220) as claude.
  • System tools: git, ripgrep (Claude Code's search backend), openssh-client, unzip, ca-certificates.
  • Python: python3 (3.11) with pip/venv (python aliased). PEP 668 — install into a venv.
  • Java toolchain: Eclipse Temurin JDK 17 (/opt/java-17) and JDK 21 (/opt/java-21), /opt/java → 21 as default (JAVA_HOME), plus Gradle 8.8 (GRADLE_HOME), all on PATH. Switch JDK per run with -e JAVA_HOME=/opt/java-17 (the entrypoint re-prepends $JAVA_HOME/bin to PATH; Gradle honours JAVA_HOME); JAVA_17_HOME/JAVA_21_HOME also point at each. Gradle is checksum-verified at build; override with --build-arg GRADLE_VERSION=x.y.
  • User / working dir: runs as non-root claude; working directory is /workspace; config lives in /home/claude/.claude.
  • Entrypoint: /usr/local/bin/claude-entrypoint — enables Bedrock and execs claude "$@", or routes to the autonomous loop runner on the loop subcommand / CLAUDE_LOOP=1.
  • Loop runner: /usr/local/bin/claude-agent-loop — drives Claude Code autonomously (see Autonomous agentic loop).
  • Token helper: /usr/local/bin/claude-token — SSO / OIDC OAuth2 client-credentials helper for on-prem gateway auth (see On-prem gateway auth).

Configuration

On-prem gateway auth via SSO / OIDC (OAuth2 client-credentials)

Gateway mode engages automatically when you set a gateway URL plus credentials (see Recipes 1–4). With SSO it calls your OIDC issuer for a client-credentials token, sends it to the gateway as Authorization: Bearer, and auto-refreshes it (per CLAUDE_CODE_API_KEY_HELPER_TTL_MS, default 5 min, and on any 401) so long loop runs never die on an expired token. The token endpoint is <OIDC_ISSUER_URL>/realms/<realm>/protocol/openid-connect/token (realm defaults to master; OIDC_LEGACY_PATH=1 if your issuer serves under /auth), or set a full GATEWAY_TOKEN_URL which is used verbatim.

Gateway / SSO variableDefaultPurpose
CLAUDE_AUTH_MODEautoForce gateway or bedrock. Auto-selects gateway when client credentials and a gateway URL are set (so it never silently falls back to Bedrock).
CLAUDE_GATEWAY_URL / ANTHROPIC_BASE_URL—The agent gateway's Anthropic-API base URL.
OIDC_ISSUER_URL—SSO base URL; builds the token endpoint.
OIDC_REALMmasterSSO realm (optional).
OIDC_LEGACY_PATH—1 if the issuer serves the token endpoint under /auth.
CLAUDE_DEBUG—1 logs the full auth/token flow to stderr (secrets masked).
GATEWAY_TOKEN_URL—Full OAuth2 token endpoint, used verbatim (nothing appended); use instead of KEYCLOAK_*.
GATEWAY_CLIENT_ID / GATEWAY_CLIENT_SECRET—Client credentials (or …_FILE; KEYCLOAK_CLIENT_ID/SECRET also accepted).
GATEWAY_SCOPE / GATEWAY_AUDIENCE—Optional OAuth2 scope / audience.
GATEWAY_AUTH_STYLEpostpost (creds in body) or basic (HTTP Basic header).
GATEWAY_EXTRA_PARAMS—Extra token-request form params, k1=v1&k2=v2.
GATEWAY_COOKIE / GATEWAY_TOKEN_HEADERS—Cookie (or *_FILE) / extra Name: Value headers for the SSO token request — some front-ends 404 without a routing cookie.
GATEWAY_TOKEN_FIELD / GATEWAY_EXPIRES_FIELDaccess_token / expires_inToken-response JSON field names.
GATEWAY_CA_BUNDLE / GATEWAY_TLS_INSECURE—CA file / skip-verify for the SSO token endpoint TLS.
CLAUDE_CODE_API_KEY_HELPER_TTL_MS300000How often Claude Code refreshes the token (ms).

Recipes — copy/paste for each on-prem setup

Pick the one that matches your endpoint. Every example is complete: substitute the URLs/keys and run.

1. On-prem OpenAI-compatible model (GLM, vLLM, Ollama, LM Studio) — API key, no OAuth

bash
podman run --rm -v "$PWD:/workspace"   -e GATEWAY_PROTOCOL=openai   -e CLAUDE_GATEWAY_URL=http://glm.internal:8000   -e GATEWAY_API_KEY=sk-your-key   -e ANTHROPIC_MODEL=glm-4.6   n8500x/claude-code -p "explain this repo"

2. Same, but the endpoint needs no auth at all

bash
podman run --rm -v "$PWD:/workspace"   -e GATEWAY_PROTOCOL=openai   -e CLAUDE_GATEWAY_URL=http://vllm.internal:8000   -e GATEWAY_NO_AUTH=1   -e ANTHROPIC_MODEL=qwen2.5-coder   n8500x/claude-code -p "explain this repo"

3. Corporate gateway fronting Bedrock, OAuth2 via SSO

bash
podman run --rm -v "$PWD:/workspace"   -e GATEWAY_PROTOCOL=openai   -e CLAUDE_GATEWAY_URL=https://agent-gw.internal   -e GATEWAY_TOKEN_URL=https://sso.internal/realms/prod/protocol/openid-connect/token   -e GATEWAY_CLIENT_ID=my-client -e GATEWAY_CLIENT_SECRET=my-secret   -e GATEWAY_COOKIE='ROUTEID=abc'   -e CLAUDE_CA_CERT=/certs/ca.pem -v /etc/pki/ca.pem:/certs/ca.pem:ro   -e ANTHROPIC_MODEL='anthropic.claude-3-7-sonnet-20250219-v1:0'   n8500x/claude-code -p "explain this repo"

4. Gateway that speaks the Anthropic API natively (/v1/messages)

bash
podman run --rm -v "$PWD:/workspace"   -e GATEWAY_PROTOCOL=anthropic   -e CLAUDE_GATEWAY_URL=https://agent-gw.internal   -e GATEWAY_API_KEY=sk-your-key   -e ANTHROPIC_MODEL='anthropic.claude-3-7-sonnet-20250219-v1:0'   -e CLAUDE_BRIDGE_ALWAYS=1   n8500x/claude-code -p "explain this repo"

(CLAUDE_BRIDGE_ALWAYS=1 keeps the bridge in the path for request logging without translating anything — drop it for a direct connection.)

5. Autonomous Java codegen from a private repo's skills

bash
podman run --rm --user root -v "$PWD:/workspace"   -e CLAUDE_PROFILE=java -e CLAUDE_JAVA=17   -e GATEWAY_PROTOCOL=openai -e CLAUDE_GATEWAY_URL=http://glm.internal:8000   -e GATEWAY_API_KEY=sk-your-key -e ANTHROPIC_MODEL=glm-4.6   -e GIT_SSH_KEY_FILE=/keys/id -v ~/.ssh/id_ed25519:/keys/id:ro   -e CLONE_REPO='git@git.internal:org/repo.git'   -e CLAUDE_SHOW_CODE=1   n8500x/claude-code loop "Using the skill in .claude/skills, generate the REST layer"

6. Bedrock directly (no gateway)

bash
podman run --rm -v "$PWD:/workspace"   -e AWS_REGION=us-east-1   -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN   -e ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0'   n8500x/claude-code -p "explain this repo"

Auth is chosen by what you set — no flag needed:

You setAuth used
GATEWAY_API_KEYstatic bearer token, no SSO
GATEWAY_NO_AUTH=1none
GATEWAY_CLIENT_ID + SECRET + (OIDC_ISSUER_URL or GATEWAY_TOKEN_URL)OAuth2 client-credentials, auto-refreshed
nothing gateway-ishAWS Bedrock (SigV4)

When it doesn't work, add -e CLAUDE_DEBUG=1 (full auth/token/model trace) or -e BRIDGE_LOG_BODY=1 (exact request/response bodies). See Troubleshooting.

Gateway protocol switch (Anthropic or OpenAI)

Set only the base URL and pick the protocol with one switch — it selects both the endpoint path and the message JSON format:

GATEWAY_PROTOCOLClaude talks toJSON
anthropic (default)<base>/v1/messagesnative, no bridge
openai<base>/v1/chat/completionstranslated by the built-in bridge
bash
-e GATEWAY_PROTOCOL=openai -e CLAUDE_GATEWAY_URL=https://agent-gw.internal      # base URL only

The URL is normalised: if you include /v1/messages or /v1/chat/completions it's stripped (and the matching protocol auto-selected), so paths can never double up. Override the upstream path with GATEWAY_CHAT_PATH. Startup prints what it resolved:

protocol: openai — Claude /v1/messages → bridge → https://agent-gw.internal/v1/chat/completions (JSON translated)

The bridge translates tool calls and SSE streaming both ways, and logs each rewrite in colour (▶ REWRITE … → OpenAI POST …). CLAUDE_DEBUG=1 adds the translated JSON; gateway errors print in red with the verbatim body. CLAUDE_TRACE=1 (either protocol) logs raw request/response.

Tell-tale that you need openai: the gateway replies Cannot POST /v1/messages.

Bedrock model selection

ANTHROPIC_MODEL is unset by default (CLI uses its Bedrock defaults). Pin one with -e ANTHROPIC_MODEL='us.anthropic.claude-...-v1:0'. The model must be enabled in AWS_REGION, and the ID is usually an inference-profile ID (us./eu./apac. prefix), not a bare foundation-model ID.

Environment variables

VariableDefaultPurpose
JAVA_HOME/opt/java (→ 21)Active JDK. Override per run, e.g. -e JAVA_HOME=/opt/java-17; the entrypoint puts $JAVA_HOME/bin first on PATH.
JAVA_17_HOME / JAVA_21_HOME/opt/java-17 / /opt/java-21Fixed paths to each Temurin JDK.
GRADLE_HOME/opt/gradle/gradle-8.8Gradle 8.8.
CLAUDE_CODE_USE_BEDROCK1Route the Anthropic protocol to AWS Bedrock.
AWS_REGIONus-east-1Bedrock region hosting the target model.
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN—Credentials (standard AWS SDK chain).
AWS_PROFILE—Named profile; mount ~/.aws to /home/claude/.aws.
AWS_BEARER_TOKEN_BEDROCK—Bedrock API key, as an alternative to SigV4 creds.
ANTHROPIC_MODEL / ANTHROPIC_SMALL_FAST_MODELCLI defaultPin Bedrock inference profiles.
CLAUDE_YOLOunsetIf 1, adds --dangerously-skip-permissions to interactive/-p runs (no tool prompts).
CLAUDE_USE_BEDROCK1Set to 0 to unset CLAUDE_CODE_USE_BEDROCK (use direct API / a gateway instead).
Agentic loop(used by the loop subcommand / CLAUDE_LOOP=1)
CLAUDE_LOOP0If 1, run the autonomous loop instead of a normal session.
CLAUDE_TASK / CLAUDE_TASK_FILE— / /workspace/TASK.mdThe goal, inline or from a file (CLI args win over both).
CLAUDE_LOOP_MAX_ITERS25Outer-loop iteration cap.
CLAUDE_MAX_BUDGET_USD / CLAUDE_LOOP_MAX_BUDGET_USD—Per-iteration and cumulative spend caps (USD).
CLAUDE_DONE_SENTINELCLAUDE_TASK_COMPLETELine the agent emits to signal completion.
CLAUDE_LOOP_MAX_ERRORS3Abort after this many consecutive failed iterations.
CLAUDE_STOP_FILE / CLAUDE_LOG_DIR/workspace/.claude-stop / /workspace/.claude-loopGraceful-stop trigger and per-iteration JSON logs.
CLAUDE_MODEL—Passed through as --model (loop mode).
DISABLE_AUTOUPDATER / DISABLE_TELEMETRY / DISABLE_ERROR_REPORTING / CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC1Disable phone-home / auto-update for restricted networks.

Mounts

PathPurpose
/workspaceYour project directory (working dir).
/home/claude/.claudeClaude Code config/state — mount a named volume to persist across runs.
/home/claude/.awsMount ~/.aws (read-only) when using AWS_PROFILE.

Air-gapped / on-prem deployment

Runs fully offline against only your internal gateway or a Bedrock VPC endpoint.

Self-contained at runtime. CLI, toolchain, token helper and docs are baked in — nothing is fetched at start. Prove it: docker run --rm --network none n8500x/claude-code help. Telemetry, error reporting and the auto-updater are off by default.

Private CA (usually required). Internal SSO / gateways present a corporate-CA cert. Mount it at run time — -e CLAUDE_CA_CERT=/certs/ca.pem -v /path/ca.pem:/certs/ca.pem:ro — and both hops trust it; or bake it at build by dropping *.crt into certs/. -e CLAUDE_TLS_INSECURE=1 skips verification on trusted networks.

Distribute offline: docker save n8500x/claude-code | gzip > cc.tar.gz, copy across the gap, docker load < cc.tar.gz.

Building your projects needs internal mirrors — the image ships toolchains, not a dep cache. Gradle: use the baked gradle (not ./gradlew) + internal Maven repo. npm/pip: point at your registry.

Running in Jenkins (CI)

Run headless from any Jenkins agent with Docker. No TTY in a build, so no -it — use -p "PROMPT" or loop "GOAL"; both stream to the build log and return meaningful exit codes. Feed credentials from Jenkins Credentials.

Gateway (SSO) — Jenkinsfile stage:

groovy
stage('Agent task') {
  steps {
    withCredentials([usernamePassword(credentialsId: 'gateway-sso',
                     usernameVariable: 'GW_ID', passwordVariable: 'GW_SECRET')]) {
      sh '''
        docker run --rm --user root -v "$WORKSPACE:/workspace" \
          -e CLAUDE_GATEWAY_URL=https://agent-gw.internal/anthropic \
          -e OIDC_ISSUER_URL=https://sso.internal \
          -e ANTHROPIC_MODEL=anthropic.claude-3-7-sonnet-20250219-v1:0 \
          -e GATEWAY_CLIENT_ID="$GW_ID" -e GATEWAY_CLIENT_SECRET="$GW_SECRET" \
          n8500x/claude-code -p "Review the diff and add any missing unit tests."
      '''
    }
  }
}

Swap -p "…" for loop "…" (add -e CLAUDE_LOOP_MAX_ITERS=15) for an autonomous multi-step run. For Bedrock (SigV4) instead, bind AWS creds via AmazonWebServicesCredentialsBinding and pass -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN.

CI notes

  • No -it (no TTY). loop bypasses prompts; for -p add -e CLAUDE_YOLO=1.
  • Exit codes drive pass/fail: loop → 0 done / 4 max-iters / 3 budget / 1 errors; -p non-zero on failure.
  • File ownership: --user root lets the agent write $WORKSPACE; or --user "$(id -u):$(id -g)" -e HOME=/tmp to keep host ownership.
  • Air-gapped agents: pre-load the image (docker load); private CA is baked or via CLAUDE_CA_CERT.
  • Kubernetes: use the image as a podTemplate container and run claude -p …, or sh 'docker run …'.

Build

bash
docker build -t n8500x/claude-code .

To bake a private CA, drop *.crt into certs/ before building:

bash
cp corp-root-ca.crt certs/ && docker build -t n8500x/claude-code .

Override the pinned CLI version:

bash
docker build \
  --build-arg CLAUDE_CODE_VERSION=2.1.220 \
  -t n8500x/claude-code .

Troubleshooting

First step for any auth issue: re-run with -e CLAUDE_DEBUG=1 — it prints the auth-mode decision, the exact SSO token endpoint, the client-credentials POST + HTTP status, and the token length, so the failing hop is obvious.

SymptomLikely cause / fix
API Error: AWS default-chain credential resolve timed outGateway mode didn't engage, so it fell back to Bedrock and the AWS SDK probed EC2 metadata. Make sure both CLAUDE_GATEWAY_URL and the client id/secret are set (that pair alone now forces gateway mode), plus OIDC_ISSUER_URL (realm defaults to master). Run with -e CLAUDE_DEBUG=1 and check the ==> auth mode: line. This image disables EC2 IMDS by default so the hang is now an instant error; genuine EC2-role Bedrock users set -e AWS_EC2_METADATA_DISABLED=false.
gateway mode: SSO token request failed at startupThe SSO client-credentials exchange failed. Check GATEWAY_CLIENT_ID/SECRET, OIDC_ISSUER_URL/OIDC_REALM (or GATEWAY_TOKEN_URL), and GATEWAY_AUTH_STYLE (post vs basic). Test in isolation with debug: docker run --rm -e CLAUDE_DEBUG=1 -e OIDC_ISSUER_URL=… -e GATEWAY_CLIENT_ID=… -e GATEWAY_CLIENT_SECRET=… --entrypoint claude-token n8500x/claude-code.
HTTP 404 from the SSO token endpointEither the realm/URL is wrong, or the SSO front-end (load ***/route) needs a routing/session cookie — add -e GATEWAY_COOKIE='ROUTEID=…' (or -e GATEWAY_TOKEN_HEADERS='Cookie: …'). Creds go in the body as grant_type/client_id/client_secret (the default post style).
Unauthorized / 401 from the gateway (after SSO succeeds)SSO worked and the token reaches the gateway as Authorization: Bearer (verified) — the gateway is rejecting the token's claims, usually the wrong audience/scope. Ask your gateway team what it requires and set -e GATEWAY_SCOPE='…' (and/or -e GATEWAY_AUDIENCE=…); run -e CLAUDE_DEBUG=1 and compare the token claims: … aud=… scope=… line to that. If the gateway also needs a routing cookie, it's auto-forwarded from GATEWAY_COOKIE.
Cannot POST /v1/messages (or every request 404s)Gateway is OpenAI-shaped: set -e GATEWAY_PROTOCOL=openai (see protocol switch). -e CLAUDE_TRACE=1 prints the gateway's verbatim error.
issue with the selected model / not a recognized model id / model does not existClaude validates the selected model name, so ANTHROPIC_MODEL must not hold a raw Bedrock id. Gateway mode handles it: set -e ANTHROPIC_MODEL='<your Bedrock id>' and the image moves it into ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU}_MODEL and leaves ANTHROPIC_MODEL unset — Claude selects a recognized tier and sends your id. (Equivalently, set the three ANTHROPIC_DEFAULT_*_MODEL yourself and don't set ANTHROPIC_MODEL.) The printed settings.json shows only those three.
claude hangs / times out after auth: gatewayThe gateway isn't reachable — the startup probe prints gateway: CANNOT reach host:port. Check the URL/firewall, set HTTP_PROXY/HTTPS_PROXY if a proxy is needed, and confirm CLAUDE_GATEWAY_URL host+port.
Auth/401 errors talking to the gateway after it startsToken endpoint returns a token but the gateway rejects it — verify CLAUDE_GATEWAY_URL path and that the token's scope/audience is accepted. Add routing headers with ANTHROPIC_CUSTOM_HEADERS.
certificate verify failed / self-signed certificate (SSO or gateway)Your private CA isn't trusted. Mount it and set -e CLAUDE_CA_CERT=/certs/ca.pem -v /path/ca.pem:/certs/ca.pem:ro — the entrypoint builds a combined bundle trusted by both the SSO (Python) and gateway (Node) hops. Or bake it at build (drop into certs/). Trusted-network unblock: -e CLAUDE_TLS_INSECURE=1.
Bedrock: could not load credentials / AccessDeniedCredentials not reaching the container or the model isn't enabled in AWS_REGION. Pass AWS_* env or mount ~/.aws with AWS_PROFILE; confirm the model/inference-profile is enabled in that region.
model … not found / ValidationExceptionSet ANTHROPIC_MODEL to a valid inference-profile id (us./eu./apac. prefix) enabled in your region.
The TUI looks garbled / exits immediatelyInteractive mode needs a TTY — run with -it. For non-TTY contexts use -p or loop.
Loop never stops / stops too earlyTune CLAUDE_LOOP_MAX_ITERS; the agent must print CLAUDE_TASK_COMPLETE to finish. Inspect per-iteration JSON in /workspace/.claude-loop/.
Java build uses the wrong JDKSet -e JAVA_HOME=/opt/java-17 (or /opt/java-21). Gradle follows JAVA_HOME.

Notes

  • Bedrock access is assumed to be reachable from the container — over the internet or a VPC/PrivateLink endpoint for air-gapped setups. This image does not bundle a model backend.
  • --dangerously-skip-permissions (CLAUDE_YOLO=1) runs every tool without prompting. Only point it at workspaces you trust.
  • Credentials never bake into the image — they come in at run time via env or a mounted ~/.aws.

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 claude-code 镜像标签

docker pull docker.xuanyuan.run/n8500x/claude-code:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull n8500x/claude-code:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

一键安装

一键安装 Docker

Linux Docker 一键安装

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Apple Container

macOS 原生容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

Unraid

Unraid NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

爱快 4.0 · iKuai 镜像加速

宝塔面板

一键配置镜像源

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

版本功能对比

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

专属域名用法

专属域名 · 开启停用 · 多仓库

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 专业版 · 企业版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

docker.sock / daemon

账号

失败是否计费

manifest · blob · 计费

申请开票(企业 / 个人)

开票 · 发票 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
n8500x/claude-code
定价查看流量套餐与价格
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
50GB 仅 ¥8/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
用户协议·隐私政策·增值电信业务经营许可证:浙B2-20261007·©2024-2026 源码跳动©2024-2026 杭州源码跳动科技有限公司·商务合作:点击复制邮箱

更多 claude-code 镜像推荐

kasmweb/claude-code logo

kasmweb/claude-code

kasmweb
Claude Code CLI - Anthropic's CLI for interacting with Claude AI models from your terminal
7 次收藏1万+ 次下载
3 天前更新
openeuler/claude-code logo

openeuler/claude-code

openeuler
暂无描述
731 次下载
6 个月前更新
idachev/claude-code logo

idachev/claude-code

idachev
暂无描述
1 次收藏1万+ 次下载
1 个月前更新
jbkirkland/claude-code logo

jbkirkland/claude-code

jbkirkland
Auto updates an npm claude-code docker image with github actions built in.
1万+ 次下载
21 天前更新
bohunn/claude-code logo

bohunn/claude-code

bohunn
暂无描述
1万+ 次下载
1 个月前更新
psyb0t/claude-code logo

psyb0t/claude-code

psyb0t
暂无描述
1万+ 次下载
4 个月前更新

查看更多 claude-code 相关镜像