Skip to content

Commit 1d1ff28

Browse files
committed
update ports/claude
1 parent 5dd16f3 commit 1d1ff28

2 files changed

Lines changed: 80 additions & 1 deletion

File tree

ports/claude/Dockerfile

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
# syntax=docker/dockerfile:1
2+
# Code generated from Dockerfile.tmpl by scripts/gen-dockerfiles; DO NOT EDIT.
3+
14
# syntax=docker/dockerfile:1
25

36
# Claude Code ships as a single binary, so this port has an `http` source rather
47
# than a parent image: it has no base image (no FROM ${BASE}), so the base is
58
# chosen here. clade injects the selected version as the BASE_TAG build-arg, and
69
# a rebuild is triggered whenever the stable release advances (its primary
7-
# {{.Major}}.{{.Minor}}.{{.Patch}} tag goes missing in the destination repo).
10+
# <no value>.<no value>.<no value> tag goes missing in the destination repo).
811
FROM docker.io/library/debian:bookworm-slim
912

1013
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
@@ -39,3 +42,25 @@ RUN set -eu; \
3942
printf '%s %s\n' "${checksum}" "${out}" | sha256sum -c -; \
4043
chmod +x "${out}"; \
4144
claude --version
45+
46+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
47+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
48+
rm -f /etc/apt/apt.conf.d/docker-clean \
49+
&& export DEBIAN_FRONTEND=noninteractive \
50+
&& apt-get update \
51+
&& apt-get install -y --no-install-recommends \
52+
python3 \
53+
python3-pip \
54+
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
55+
&& locale-gen
56+
57+
ARG USERNAME=hypnos
58+
ARG USER_UID=1000
59+
ARG USER_GID=1000
60+
RUN groupadd "${USERNAME}" --gid ${USER_GID} \
61+
&& useradd --create-home "${USERNAME}" --shell /usr/bin/zsh --uid "${USER_UID}" --gid "${USER_GID}" \
62+
&& echo "${USERNAME}:${USERNAME}" | chpasswd \
63+
&& echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/${USERNAME}"
64+
65+
USER ${USERNAME}
66+
WORKDIR /home/${USERNAME}

ports/claude/Dockerfile.tmpl

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# Claude Code ships as a single binary, so this port has an `http` source rather
4+
# than a parent image: it has no base image (no FROM ${BASE}), so the base is
5+
# chosen here. clade injects the selected version as the BASE_TAG build-arg, and
6+
# a rebuild is triggered whenever the stable release advances (its primary
7+
# {{.Major}}.{{.Minor}}.{{.Patch}} tag goes missing in the destination repo).
8+
FROM docker.io/library/debian:bookworm-slim
9+
10+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
11+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
12+
rm -f /etc/apt/apt.conf.d/docker-clean \
13+
&& export DEBIAN_FRONTEND=noninteractive \
14+
&& apt-get update \
15+
&& apt-get install -y --no-install-recommends \
16+
ca-certificates \
17+
curl \
18+
git \
19+
jq
20+
21+
# Install Claude Code from the official release channel. clade injects the
22+
# resolved stable version as BASE_TAG; for that version we read the manifest to
23+
# get the per-platform checksum, download the binary, and verify it before use.
24+
# The base image is glibc (debian), so the platform is linux-<arch> (no -musl).
25+
ARG BASE_TAG
26+
RUN set -eu; \
27+
case "$(uname -m)" in \
28+
x86_64 | amd64) arch="x64" ;; \
29+
arm64 | aarch64) arch="arm64" ;; \
30+
*) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;; \
31+
esac; \
32+
platform="linux-${arch}"; \
33+
base_url="https://downloads.claude.ai/claude-code-releases"; \
34+
manifest="$(curl -fsSL "${base_url}/${BASE_TAG}/manifest.json")"; \
35+
checksum="$(printf '%s' "${manifest}" | jq -r ".platforms[\"${platform}\"].checksum // empty")"; \
36+
[ -n "${checksum}" ] || { echo "Platform ${platform} not found in manifest" >&2; exit 1; }; \
37+
out=/usr/local/bin/claude; \
38+
curl -fsSL -o "${out}" "${base_url}/${BASE_TAG}/${platform}/claude"; \
39+
printf '%s %s\n' "${checksum}" "${out}" | sha256sum -c -; \
40+
chmod +x "${out}"; \
41+
claude --version
42+
43+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
44+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
45+
rm -f /etc/apt/apt.conf.d/docker-clean \
46+
&& export DEBIAN_FRONTEND=noninteractive \
47+
&& apt-get update \
48+
&& apt-get install -y --no-install-recommends \
49+
python3 \
50+
python3-pip \
51+
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
52+
&& locale-gen
53+
54+
{{ template "user.dockerfile" . }}

0 commit comments

Comments
 (0)