Compare commits

..

5 Commits

Author SHA1 Message Date
julian ac9fa93a2d Try to use nixos host runner
Build and Publish Runner Image / build-and-push (push) Failing after 6m1s
2026-06-11 21:02:15 +02:00
julian 098622c128 Try changing mtu to allow uploading of the docker container
Build and Publish Runner Image / build-and-push (push) Failing after 5s
2026-06-11 20:52:15 +02:00
julian 06c14e0c56 Update dockerfile to install devenv
Build and Publish Runner Image / build-and-push (push) Failing after 9m16s
2026-06-11 20:35:02 +02:00
julian 0da0e3c7fc Remove devenv from dockerfile
Build and Publish Runner Image / build-and-push (push) Successful in 16s
2026-06-04 17:45:02 +02:00
julian 222cd094f8 Optimize dockerfile
Build and Publish Runner Image / build-and-push (push) Has been cancelled
2026-06-04 17:39:32 +02:00
2 changed files with 23 additions and 13 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ env:
jobs: jobs:
build-and-push: build-and-push:
# We use the standard ubuntu-latest to build our custom runner # We use the standard ubuntu-latest to build our custom runner
runs-on: ubuntu-latest runs-on: nixos
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
+22 -12
View File
@@ -1,24 +1,34 @@
# Start with a official gitea runner image based on ubuntu with node installed # Start with an official gitea runner image based on ubuntu with node installed
FROM docker.gitea.com/runner-images:ubuntu-latest-slim FROM docker.gitea.com/runner-images:ubuntu-latest-slim
# Explicitly set the USER environment variable (expected by the Nix installer)
ENV USER=root
# Install system dependencies # Install system dependencies
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y sudo bash jq xz-utils curl && \ apt-get install -y sudo bash jq xz-utils curl git ca-certificates && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Install Nix as a multi-user installation # Pre-configure Nix:
RUN curl -L https://nixos.org/nix/install | sh -s -- --daemon # 1. Enable flakes
ENV PATH="/nix/var/nix/profiles/default/bin:$PATH" # 2. Disable build-users-group (Fixes the missing 'nixbld' group error for root installs)
# 3. Add devenv substituters for fast compiling
# Enable flakes and nix-command
RUN mkdir -p /etc/nix && \ RUN mkdir -p /etc/nix && \
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf echo "experimental-features = nix-command flakes" > /etc/nix/nix.conf && \
echo "build-users-group =" >> /etc/nix/nix.conf && \
echo "extra-substituters = https://devenv.cachix.org" >> /etc/nix/nix.conf && \
echo "extra-trusted-public-keys = devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" >> /etc/nix/nix.conf && \
echo "trusted-users = root" >> /etc/nix/nix.conf
# Install devenv (the Nix way, not the apt-get way) # Install Nix in single-user mode (--no-daemon)
RUN nix profile add nixpkgs#devenv RUN curl -L https://nixos.org/nix/install | sh -s -- --no-daemon
# Cleanup, otherwise nix panicks # Update PATH so subsequent RUN commands and the final container can find Nix
RUN rm -rf /homeless-shelter ENV PATH="/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH"
# Install devenv using the modern flake URL and clean up build garbage
RUN nix profile install --accept-flake-config github:cachix/devenv/latest && \
nix-collect-garbage -d
CMD ["/bin/bash"] CMD ["/bin/bash"]