Compare commits

...
8 Commits
Author SHA1 Message Date
Job79andClaude Opus 5.5 acba767594 ci: push images with zstd:chunked compression
Build containers / build (push) Failing after 38s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:47:14 +01:00
Job79andClaude Opus 5.5 47c027025f fix(base): remove lazygit
The lazygit download is currently broken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:47:14 +01:00
Job79andClaude Opus 5.5 878c925f12 refactor: rename go container to web
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:46:59 +01:00
Job79andClaude Opus 5.5 410e6e6410 refactor: run infra as a profile on the base image
The infra image was identical to base. config.sh can now set image= to
reuse another image, so infra no longer needs to be built and pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:46:59 +01:00
Job79andClaude Opus 5.5 4d657656cd refactor(devc): harden entry script
- Resolve config.sh relative to the real script path (works via symlink).
- Don't silently swallow errors from config.sh.
- Default DEVC_REGISTRY to git.plabble.org/job79.
- Add -no-pull to start without contacting the registry.
- Host wrappers explain how to enable host-spawn instead of failing
  obscurely.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:46:59 +01:00
Job79andClaude Opus 5.5 12534d3afd ci: simplify container build workflow
- Drop the changes job; the on.paths filter already does this.
- Build all images in one job with buildah, so dependent images use the
  freshly built local base instead of pulling it.
- Only push outside of pull requests; PR builds use a pr-<n> tag.
- Reference the base image by its full registry path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:46:59 +01:00
Job79andClaude Opus 5.5 9c6569fa29 perf: shrink images and harden downloads
- Keep Go module/build and bun caches in cache mounts instead of layers.
- Split base tool downloads into layers ordered by change frequency.
- Use curl -f and pipefail so failed downloads break the build.
- Resolve the lazygit version from the release redirect instead of the
  rate-limited GitHub API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:46:59 +01:00
Job79andClaude Opus 5.5 0397174460 refactor(base): set environment via ENV instead of bashrc
Variables in .bashrc only reached interactive shells, so commands started
with DEVC_COMMAND or a plain podman exec missed them. Also disable the
Claude auto-updater, as /usr/local/bin is not writable and the image is
rebuilt weekly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:46:59 +01:00
10 changed files with 81 additions and 123 deletions

No files matched your search

+24 -85
View File
@@ -10,96 +10,35 @@ on:
schedule:
- cron: "0 16 * * FRI"
env:
REGISTRY: git.plabble.org
# Images in build order; later images build FROM the local base image.
IMAGES: base web
TAG: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref_name }}
PUSH: ${{ github.event_name != 'pull_request' }}
jobs:
changes:
runs-on: job-v2
outputs:
any_container_change: ${{ steps.filter.outputs.containers == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: https://github.com/dorny/paths-filter@v3
id: filter
with:
filters: |
workflow: ['.gitea/workflows/build.yaml']
containers: ['containers/**']
base-image:
needs: [changes]
if: ${{ needs.changes.outputs.any_container_change == 'true' }}
build:
runs-on: job-v2
steps:
- uses: actions/checkout@v6
- name: Log in
uses: redhat-actions/podman-login@v1
with:
registry: git.plabble.org
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build
id: build
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
with:
image: job79/base
tags: ${{ github.ref_name }}
context: ./containers/base
containerfiles: ./containers/base/Containerfile
platforms: linux/amd64
run: |
for image in $IMAGES; do
pull=missing; [[ $image == base ]] && pull=newer
buildah build --pull="$pull" --platform linux/amd64 \
--build-arg TAG="$TAG" \
-t "$REGISTRY/job79/$image:$TAG" "containers/$image"
done
- name: Push
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: git.plabble.org
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
extra-args: |
--compression-format=zstd
--compression-level=12
dependent-images:
needs: [changes, base-image]
if: ${{ needs.changes.outputs.any_container_change == 'true' }}
runs-on: job-v2
strategy:
fail-fast: false
matrix:
container: [infra, go]
steps:
- name: Clone repo
uses: actions/checkout@v6
- name: Log in
uses: redhat-actions/podman-login@v1
with:
registry: git.plabble.org
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build
id: build
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
with:
image: job79/${{ matrix.container }}
tags: ${{ github.ref_name }}
context: ./containers/${{ matrix.container }}
containerfiles: ./containers/${{ matrix.container }}/Containerfile
build-args: TAG=${{ github.ref_name }}
platforms: linux/amd64
- name: Push
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: git.plabble.org
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
extra-args: |
--compression-format=zstd
--compression-level=12
if: env.PUSH == 'true'
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
buildah login -u "$REGISTRY_USERNAME" --password-stdin "$REGISTRY" <<<"$REGISTRY_TOKEN"
for image in $IMAGES; do
buildah push --compression-format=zstd:chunked --compression-level=12 "$REGISTRY/job79/$image:$TAG"
done
+9 -8
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# =============================================== #
# devc.sh v2.1; job79, maurice #
# devc.sh v2.2; job79, maurice #
# Dev container entry script. #
# =============================================== #
set -euo pipefail
@@ -23,11 +23,11 @@ default_args() {
# Desktop integration (Wayland, SSH).
[[ -e "/run/user/$UID/wayland-0" ]] && run_opts+=("-v" "/run/user/$UID/wayland-0:/run/user/1000/wayland-0")
[[ -e "${SSH_AUTH_SOCK:-}" ]] && run_opts+=("-v" "$SSH_AUTH_SOCK:/run/user/1000/ssh-auth-sock" "-e" "SSH_AUTH_SOCK=/run/user/1000/ssh-auth-sock")
[[ -e "${SSH_AUTH_SOCK:-}" ]] && run_opts+=("-v" "$SSH_AUTH_SOCK:/run/user/1000/ssh-auth-sock")
# Load custom container config.
local config_file="${BASH_SOURCE[0]%/*}/../containers/$name/config.sh"
[[ -f "$config_file" ]] && source "$config_file" || true
local config_file="$(dirname "$(realpath "${BASH_SOURCE[0]}")")/../containers/$name/config.sh"
[[ ! -f "$config_file" ]] || source "$config_file"
}
# param_args parses CLI arguments into podman run options.
@@ -35,6 +35,7 @@ param_args() {
while (($# > 0)); do
case "$1" in
-gpu) run_opts+=("--device" "/dev/dri") ;;
-no-pull) run_opts+=("--pull=never") ;;
-host-spawn) run_opts+=("-v" "/run/user/$UID/bus:/tmp/bus" "-e" "HOST_HOME=$HOME") ;;
-container-sock) run_opts+=("-v" "$XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock") ;;
-x11) run_opts+=("-v" "/tmp/.X11-unix:/tmp/.X11-unix" "-v" "$XAUTHORITY:/run/user/1000/.Xauthority:ro" "-e" "DISPLAY=$DISPLAY" "-e" "XAUTHORITY=/run/user/1000/.Xauthority") ;;
@@ -59,17 +60,17 @@ main() {
else
die "no container name specified"
fi
local name="${image%:*}"
local name="${image%:*}" tag="${image#*:}"
image="$name" # config.sh may override (e.g. image=base).
# Start/Restart if not running or if arguments change configuration.
if [[ -z "$(podman ps -q -f name="^$name$" -f status=running)" ]] || (($# > 0)); then
log "starting $image..."
log "starting $name:$tag..."
default_args
param_args "$@"
[[ -n "${DEVC_REGISTRY:-}" ]] || die "registry unknown; set the DEVC_REGISTRY environment variable"
podman run --replace --stop-timeout 0 -td "${run_opts[@]}" "$DEVC_REGISTRY/$image"
podman run --replace --stop-timeout 0 -td "${run_opts[@]}" "${DEVC_REGISTRY:-git.plabble.org/job79}/$image:$tag"
fi
exec podman exec --detach-keys "ctrl-@,ctrl-@" -it "$name" ${DEVC_COMMAND:-bash -l}
+20 -6
View File
@@ -7,18 +7,32 @@ RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
bash-completion git-core fzf curl awk jq rg unzip which \
host-spawn wl-copy gcc tree-sitter-cli
RUN LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | jq -r .tag_name | sed 's/^v//') && \
curl -sL "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_linux_x86_64.tar.gz" | tar xz -C /usr/local/bin lazygit && \
curl -sL "https://github.com/jorgerojas26/lazysql/releases/latest/download/lazysql_Linux_x86_64.tar.gz" | tar xz -C /usr/local/bin lazysql && \
curl -sL "https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz" | tar xz -C /usr/local --strip-components=1 && \
curl -fsSL https://bun.sh/install | BUN_INSTALL="/usr/local" bash && \
ln -sf /usr/local/bin/bun /usr/local/bin/node && \
# === install tools (least to most frequently changing) ===
RUN set -o pipefail && \
curl -fsSL "https://github.com/jorgerojas26/lazysql/releases/latest/download/lazysql_Linux_x86_64.tar.gz" | tar xz -C /usr/local/bin lazysql
RUN set -o pipefail && \
curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local bash && \
ln -sf /usr/local/bin/bun /usr/local/bin/node
RUN set -o pipefail && \
curl -fsSL https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz | tar xz -C /usr/local --strip-components=1
RUN set -o pipefail && \
curl -fsSL https://claude.ai/install.sh | bash && \
cp -L /root/.local/bin/claude /usr/local/bin/ && \
rm -rf /root/.local
COPY ./bin /usr/local/bin
# === environment ===
ENV EDITOR=nvim \
TZ=Europe/Amsterdam \
XDG_RUNTIME_DIR=/run/user/1000 \
WAYLAND_DISPLAY=wayland-0 \
SSH_AUTH_SOCK=/run/user/1000/ssh-auth-sock \
DISABLE_AUTOUPDATER=1
# === setup user ===
RUN useradd -ms /bin/bash user && \
echo 'user ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/user && \
+1
View File
@@ -1,5 +1,6 @@
#!/bin/bash
export DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/bus"
[[ -S /tmp/bus ]] || { echo "host-spawn unavailable: restart with 'devc -host-spawn'" >&2; exit 1; }
cmd="${0##*/}"
[[ "$cmd" == "host" ]] && unset cmd
+2 -7
View File
@@ -1,12 +1,7 @@
source /etc/bashrc
# === environment ===
export PS1="\[\e[30;46m\] \h | \w \[\e[0;36m\]\[\e[m\] " \
EDITOR="nvim" \
WAYLAND_DISPLAY="wayland-0" \
XDG_RUNTIME_DIR="/run/user/1000" \
SSH_AUTH_SOCK="/run/user/1000/ssh-auth-sock" \
TZ="Europe/Amsterdam"
# === prompt ===
export PS1="\[\e[30;46m\] \h | \w \[\e[0;36m\]\[\e[m\] "
# === aliases and functions ===
alias vi=nvim
-15
View File
@@ -1,15 +0,0 @@
ARG TAG
FROM job79/base:${TAG}
USER root
RUN GO_VERSION=$(curl -sL "https://go.dev/VERSION?m=text" | head -n 1 | tr -d '\r\n') && \
curl -sL "https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz" | tar xz -C /usr/local && \
ln -sf /usr/local/go/bin/go /usr/local/bin/go && \
ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt && \
GOBIN=/usr/local/bin /usr/local/go/bin/go install golang.org/x/tools/gopls@latest && \
GOBIN=/usr/local/bin /usr/local/go/bin/go install mvdan.cc/gofumpt@latest && \
GOBIN=/usr/local/bin /usr/local/go/bin/go install golang.org/x/tools/cmd/goimports@latest && \
GOBIN=/usr/local/bin /usr/local/go/bin/go install github.com/go-delve/delve/cmd/dlv@latest && \
BUN_INSTALL="/usr/local" bun install -g typescript typescript-language-server @tailwindcss/language-server svelte-language-server @biomejs/biome
USER user
-2
View File
@@ -1,2 +0,0 @@
ARG TAG
FROM job79/base:${TAG}
+1
View File
@@ -1,2 +1,3 @@
#!/bin/bash
image=base
run_opts+=("-v" "$HOME/Code/infra:/home/user/Code/infra")
+24
View File
@@ -0,0 +1,24 @@
ARG TAG=main
FROM git.plabble.org/job79/base:${TAG}
USER root
RUN set -o pipefail && \
GO_VERSION=$(curl -fsSL "https://go.dev/VERSION?m=text" | head -n 1 | tr -d '\r\n') && \
curl -fsSL "https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz" | tar xz -C /usr/local && \
ln -sf /usr/local/go/bin/go /usr/local/go/bin/gofmt /usr/local/bin/
# Build caches live in cache mounts so they don't end up in the image.
RUN --mount=type=cache,id=go-mod,target=/root/go/pkg/mod \
--mount=type=cache,id=go-build,target=/root/.cache/go-build \
for pkg in \
golang.org/x/tools/gopls \
golang.org/x/tools/cmd/goimports \
mvdan.cc/gofumpt \
github.com/go-delve/delve/cmd/dlv; \
do GOBIN=/usr/local/bin go install "$pkg@latest" || exit 1; done
RUN --mount=type=cache,id=bun-cache,target=/root/.bun-cache \
BUN_INSTALL=/usr/local BUN_INSTALL_CACHE_DIR=/root/.bun-cache bun install -g \
typescript typescript-language-server @tailwindcss/language-server svelte-language-server @biomejs/biome
USER user
File renamed without changes.