Add container

This commit is contained in:
Alois 2026-08-20 17:46:10 +02:00
commit 699b4af434
Signed by: alois
SSH key fingerprint: SHA256:GBzT2DXvAuGV9XIV5W3WrzVpjU54FThmxHXdbz95J24
4 changed files with 61 additions and 1 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
.docker
.git

View file

@ -0,0 +1,38 @@
name: Build runner image
on:
workflow_dispatch:
jobs:
build:
runs-on: nixos
steps:
- name: Install checkout dependency
run: nix profile add nixpkgs#nodejs_24
- name: Check out repository
uses: https://data.forgejo.org/actions/checkout@v4
with:
persist-credentials: false
- name: Configure registry authentication
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -eu
mkdir -p .docker
AUTH="$(printf '%s' "$REGISTRY_USER:$REGISTRY_TOKEN" | base64 -w 0)"
printf '{"auths":{"git.methanium.net":{"auth":"%s"}}}\n' "$AUTH" > .docker/config.json
- name: Build and publish image
uses: docker://ghcr.io/osscontainertools/kaniko:v1.28.3
env:
DOCKER_CONFIG: ${{ forgejo.workspace }}/.docker
with:
entrypoint: /kaniko/executor
args: >-
--context=${{ forgejo.workspace }}
--dockerfile=${{ forgejo.workspace }}/Dockerfile
--destination=git.methanium.net/alois/nixos-docker-container:2.32.8
--push-retry=3

13
Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM docker.io/nixos/nix:2.32.8
LABEL org.opencontainers.image.source="https://git.methanium.net/alois/nixos-docker-container"
RUN nix profile add \
nixpkgs#bun \
nixpkgs#gnused \
nixpkgs#jdk21 \
nixpkgs#jq \
nixpkgs#nodejs_24 \
nixpkgs#pnpm \
nixpkgs#rsync \
nixpkgs#stdenv.cc

View file

@ -1,2 +1,9 @@
# nixos-docker-container Runner image: `git.methanium.net/alois/nixos-docker-container:2.32.8`
Forgejo runner config:
```yaml
runner:
labels:
- nixos:docker://git.methanium.net/alois/nixos-docker-container:2.32.8
```