Claude Code commited on
Commit
2bc32e8
Β·
1 Parent(s): 3a26b1b

Claude Code: Add network retry and fault tolerance to Dockerfile

Browse files

- Add --retry-on-error to apt-get update
- Add retry wrapper to git clone for A2A gateway
- Add --no-cache-dir to npm install for A2A gateway

Files changed (1) hide show
  1. Dockerfile +6 -4
Dockerfile CHANGED
@@ -22,7 +22,7 @@ ARG NODE_ENV=production
22
  # ── System dependencies (root) ───────────────────────────────────────────────
23
  # Optimization: Install Python and system deps in minimal layers for caching
24
  RUN echo "[build] Installing system dependencies..." && START=$(date +%s) \
25
- && apt-get update \
26
  # Minimal install: git for cloning, ca-certificates for HTTPS, curl for health checks
27
  && apt-get install -y --no-install-recommends \
28
  git \
@@ -90,10 +90,12 @@ WORKDIR /app
90
  # ── A2A Gateway Extension ───────────────────────────────────────────────────
91
  # Install extension as non-root user
92
  RUN echo "[build] Installing A2A gateway..." && START=$(date +%s) \
93
- && git clone --depth 1 https://github.com/win4r/openclaw-a2a-gateway.git \
94
- /app/openclaw/extensions/a2a-gateway \
 
 
95
  && cd /app/openclaw/extensions/a2a-gateway \
96
- && npm install --production \
97
  && echo "[build] A2A gateway: $(($(date +%s) - START))s"
98
 
99
  # ── Coding Agent Extension (local β€” no git clone needed) ─────────────────────
 
22
  # ── System dependencies (root) ───────────────────────────────────────────────
23
  # Optimization: Install Python and system deps in minimal layers for caching
24
  RUN echo "[build] Installing system dependencies..." && START=$(date +%s) \
25
+ && apt-get update --retry-on-error \
26
  # Minimal install: git for cloning, ca-certificates for HTTPS, curl for health checks
27
  && apt-get install -y --no-install-recommends \
28
  git \
 
90
  # ── A2A Gateway Extension ───────────────────────────────────────────────────
91
  # Install extension as non-root user
92
  RUN echo "[build] Installing A2A gateway..." && START=$(date +%s) \
93
+ && (git clone --depth 1 https://github.com/win4r/openclaw-a2a-gateway.git \
94
+ /app/openclaw/extensions/a2a-gateway || \
95
+ (sleep 5 && git clone --depth 1 https://github.com/win4r/openclaw-a2a-gateway.git \
96
+ /app/openclaw/extensions/a2a-gateway)) \
97
  && cd /app/openclaw/extensions/a2a-gateway \
98
+ && npm install --production --no-cache-dir \
99
  && echo "[build] A2A gateway: $(($(date +%s) - START))s"
100
 
101
  # ── Coding Agent Extension (local β€” no git clone needed) ─────────────────────