Add container
This commit is contained in:
parent
bafad9823b
commit
699b4af434
4 changed files with 61 additions and 1 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.docker
|
||||
.git
|
||||
38
.forgejo/workflows/build.yml
Normal file
38
.forgejo/workflows/build.yml
Normal 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
13
Dockerfile
Normal 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
|
||||
|
|
@ -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
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue