Change base docker image with more stuff preinstalled
Build and Publish Runner Image / build-and-push (push) Failing after 41s
Build and Publish Runner Image / build-and-push (push) Failing after 41s
This commit is contained in:
+11
-18
@@ -1,25 +1,18 @@
|
|||||||
# Start with the official Cachix Devenv image (which has Nix and Devenv pre-installed)
|
# Start with a official gitea runner image based on ubuntu with node installed
|
||||||
FROM ghcr.io/cachix/devenv/devenv:latest
|
FROM docker.gitea.com/runner-images:ubuntu-latest-slim
|
||||||
|
|
||||||
# Switch to root to install system-level packages
|
# Install Nix as a multi-user installation
|
||||||
USER root
|
RUN curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||||
|
ENV PATH="/nix/var/nix/profiles/default/bin:$PATH"
|
||||||
|
|
||||||
# Install the critical dependencies for Gitea Actions
|
# Enable flakes and nix-command
|
||||||
# - nodejs: Required to run standard actions (like actions/checkout)
|
RUN mkdir -p /etc/nix && \
|
||||||
# - sudo: Required by many actions to escalate privileges
|
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
||||||
# - bash & jq: Standard utilities often expected in CI scripts
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y nodejs sudo bash jq && \
|
|
||||||
apt-get clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Allow passwordless sudo for any user in the container.
|
# Install devenv (the Nix way, not the apt-get way)
|
||||||
# CI runners often execute as 'runner' or 'root'. This guarantees neither gets stuck.
|
RUN nix profile install nixpkgs#devenv
|
||||||
RUN echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
|
||||||
|
|
||||||
# Guarantee the image ships without the Nix sandboxing artifact.
|
# Cleanup, otherwise nix panicks
|
||||||
# This prevents the "purity" crash on the very first Nix run.
|
|
||||||
RUN rm -rf /homeless-shelter
|
RUN rm -rf /homeless-shelter
|
||||||
|
|
||||||
# Set the default shell to bash
|
|
||||||
CMD ["/bin/bash"]
|
CMD ["/bin/bash"]
|
||||||
|
|||||||
Reference in New Issue
Block a user