fix image build
Some checks failed
Build Images / build (push) Failing after 44s
Check / check (push) Successful in 4m0s

This commit is contained in:
Joakim Repomaa
2026-02-22 16:59:21 +02:00
parent 5bff4d9713
commit 04dddc628f
2 changed files with 29 additions and 28 deletions

View File

@@ -14,9 +14,6 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Install Skopeo
run: nix shell nixpkgs#skopeo -c echo "skopeo installed"
- name: Build aarch64 Image - name: Build aarch64 Image
run: nix build .#dockerImages.aarch64-linux.node --out-link ./image-aarch64.tar.gz run: nix build .#dockerImages.aarch64-linux.node --out-link ./image-aarch64.tar.gz

View File

@@ -136,38 +136,42 @@
withSystem system ( withSystem system (
{ pkgs, ... }: { pkgs, ... }:
{ {
node = pkgs.dockerTools.buildImage { node =
name = "node"; let
tag = "latest"; setupDirs = pkgs.runCommand "setup-dirs" { } ''
runAsRoot = '' mkdir -p $out/tmp $out/root $out/var/tmp
#!${pkgs.runtimeShell} chmod 1777 $out/tmp $out/var/tmp
set -e '';
${pkgs.dockerTools.shadowSetup} in
groupadd -r node pkgs.dockerTools.buildLayeredImage {
useradd -r -g node -m -d /home/node node name = "node";
mkdir -p /nix tag = "latest";
chown node:node /nix contents = with pkgs; [
'';
copyToRoot = pkgs.buildEnv {
name = "image-root";
pathsToLink = [ "/" ];
paths = with pkgs; [
nodejs nodejs
nix nix
busybox busybox
bash bash
skopeo skopeo
cacert
git
setupDirs
(writeTextFile {
name = "etc-nix-nix-conf";
destination = "/etc/nix/nix.conf";
text = ''
build-users-group =
experimental-features = nix-command flakes
'';
})
]; ];
config = {
Env = [
"SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
"NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-bundle.crt"
"HOME=/root"
];
};
}; };
config = {
User = "node";
Env = [
"NIX_CONFIG=experimental-features = nix-command flakes"
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"NODE_EXTRA_CA_CERTS=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
};
};
} }
) )
); );