File size: 2,128 Bytes
784ee2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Docker image for running Claude Code with --dangerously-skip-permissions
# inside a container that can build/test OpenROAD (CMake + Bazel) and run ORFS.
#
# Usage: see claude.sh at the repo root.

ARG fromImage=openroad/flow-ubuntu22.04-dev:latest

FROM ${fromImage}

# --- Bazel support ---

# Java 21 (required by Bazel 8.x)
RUN apt-get update \
    && apt-get install -y --no-install-recommends openjdk-21-jre-headless \
    && rm -rf /var/lib/apt/lists/*

# Bazelisk (respects .bazelversion to download the correct Bazel release)
RUN curl -Lo /usr/local/bin/bazelisk \
        https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \
    && chmod +x /usr/local/bin/bazelisk \
    && ln -sf /usr/local/bin/bazelisk /usr/local/bin/bazel

# --- Claude Code support ---

# Node.js 22 LTS (Claude Code requires Node 18+)
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
    && apt-get install -y --no-install-recommends nodejs \
    && rm -rf /var/lib/apt/lists/*

# Claude Code CLI
RUN npm install -g @anthropic-ai/claude-code

# --- Convenience ---

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        sudo \
        less \
        jq \
        ripgrep \
    && rm -rf /var/lib/apt/lists/*

# VS Code CLI (code-tunnel for remote editing).
# Use the glibc build to match the Ubuntu base image. (The cli-alpine-x64
# variant on code.visualstudio.com is statically linked and also works,
# but the linux-x64 build from update.code.visualstudio.com is the
# canonical match for glibc distros.)
RUN curl -fsSL "https://update.code.visualstudio.com/latest/cli-linux-x64/stable" \
        -o /tmp/vscode-cli.tar.gz \
    && tar -xzf /tmp/vscode-cli.tar.gz -C /usr/local/bin \
    && rm /tmp/vscode-cli.tar.gz

# Trust all directories (safe inside container; the container IS the boundary)
RUN git config --system safe.directory '*'

# Entrypoint that maps host UID/GID then drops privileges
COPY claude-entrypoint.sh /usr/local/bin/claude-entrypoint.sh
RUN chmod +x /usr/local/bin/claude-entrypoint.sh

WORKDIR /workspace
ENTRYPOINT ["claude-entrypoint.sh"]