Skip to content

Commit 45ca1e3

Browse files
chapterjasonclaude
andcommitted
Add devcontainer base image with feature deps preinstalled
debian:trixie-slim base with the union of apt packages every feature in src/ installs on demand, plus common dev utilities. Pre-installing them short-circuits each feature's dpkg-s/command-v guard, so feature install becomes a single binary fetch — and removes the dpkg-lock contention the web-shell run.sh retry loop existed to paper over. Published to ghcr.io/<owner>/devcontainer-base via a multi-arch buildx workflow on master pushes and v* tags. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 04c15ed commit 45ca1e3

2 files changed

Lines changed: 94 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish Devcontainer Base Image
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- "Dockerfile.devcontainer-base"
8+
- ".github/workflows/publish-devcontainer-base.yml"
9+
tags: ["v*"]
10+
workflow_dispatch:
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-24.04
15+
permissions:
16+
contents: read
17+
packages: write
18+
steps:
19+
- uses: actions/checkout@v6
20+
21+
- name: Lowercase image name
22+
id: img
23+
run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/devcontainer-base" >> "$GITHUB_OUTPUT"
24+
25+
- uses: docker/setup-qemu-action@v4
26+
- uses: docker/setup-buildx-action@v4
27+
28+
- name: Log in to GHCR
29+
uses: docker/login-action@v4
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Extract tags
36+
id: meta
37+
uses: docker/metadata-action@v6
38+
with:
39+
images: ${{ steps.img.outputs.name }}
40+
tags: |
41+
type=ref,event=branch
42+
type=ref,event=tag
43+
type=sha,format=short
44+
type=raw,value=latest,enable={{is_default_branch}}
45+
46+
- name: Build and push
47+
uses: docker/build-push-action@v7
48+
with:
49+
context: .
50+
file: ./Dockerfile.devcontainer-base
51+
platforms: linux/amd64,linux/arm64
52+
push: true
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
cache-from: type=gha
56+
cache-to: type=gha,mode=max

Dockerfile.devcontainer-base

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
ARG BASE_IMAGE=debian:trixie-slim
2+
FROM ${BASE_IMAGE}
3+
4+
SHELL ["/bin/bash", "-c"]
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
RUN apt-get update && \
8+
apt-get install -y --no-install-recommends --no-install-suggests \
9+
build-essential \
10+
ca-certificates \
11+
curl \
12+
dtach \
13+
file \
14+
git \
15+
gnupg \
16+
htop \
17+
iputils-ping \
18+
jq \
19+
less \
20+
locales \
21+
lsb-release \
22+
lsof \
23+
openssh-client \
24+
procps \
25+
python3 \
26+
rsync \
27+
software-properties-common \
28+
strace \
29+
sudo \
30+
tar \
31+
tree \
32+
unzip \
33+
vim \
34+
wget && \
35+
rm -rf /var/lib/apt/lists/*
36+
37+
RUN sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen
38+
ENV LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8

0 commit comments

Comments
 (0)