fix image build
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
42
flake.nix
42
flake.nix
@@ -136,35 +136,39 @@
|
|||||||
withSystem system (
|
withSystem system (
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
node = pkgs.dockerTools.buildImage {
|
node =
|
||||||
|
let
|
||||||
|
setupDirs = pkgs.runCommand "setup-dirs" { } ''
|
||||||
|
mkdir -p $out/tmp $out/root $out/var/tmp
|
||||||
|
chmod 1777 $out/tmp $out/var/tmp
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
pkgs.dockerTools.buildLayeredImage {
|
||||||
name = "node";
|
name = "node";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
runAsRoot = ''
|
contents = with pkgs; [
|
||||||
#!${pkgs.runtimeShell}
|
|
||||||
set -e
|
|
||||||
${pkgs.dockerTools.shadowSetup}
|
|
||||||
groupadd -r node
|
|
||||||
useradd -r -g node -m -d /home/node node
|
|
||||||
mkdir -p /nix
|
|
||||||
chown node:node /nix
|
|
||||||
'';
|
|
||||||
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 = {
|
config = {
|
||||||
User = "node";
|
|
||||||
Env = [
|
Env = [
|
||||||
"NIX_CONFIG=experimental-features = nix-command flakes"
|
"SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
|
||||||
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
"NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-bundle.crt"
|
||||||
"NODE_EXTRA_CA_CERTS=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
"HOME=/root"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user