Update dockerfile to install devenv
Build and Publish Runner Image / build-and-push (push) Failing after 9m16s
Build and Publish Runner Image / build-and-push (push) Failing after 9m16s
This commit is contained in:
+23
-11
@@ -1,22 +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
|
||||
|
||||
# Explicitly set the USER environment variable (expected by the Nix installer)
|
||||
ENV USER=root
|
||||
|
||||
# Install system dependencies
|
||||
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 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Nix as a multi-user installation
|
||||
RUN curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
ENV PATH="/nix/var/nix/profiles/default/bin:$PATH"
|
||||
|
||||
# Enable flakes and nix-command
|
||||
# Pre-configure Nix:
|
||||
# 1. Enable flakes
|
||||
# 2. Disable build-users-group (Fixes the missing 'nixbld' group error for root installs)
|
||||
# 3. Add devenv substituters for fast compiling
|
||||
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)
|
||||
# RUN nix profile add nixpkgs#devenv && \
|
||||
# nix-collect-garbage -d
|
||||
# Install Nix in single-user mode (--no-daemon)
|
||||
RUN curl -L https://nixos.org/nix/install | sh -s -- --no-daemon
|
||||
|
||||
# Update PATH so subsequent RUN commands and the final container can find Nix
|
||||
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"]
|
||||
|
||||
Reference in New Issue
Block a user