Compare commits
2 Commits
c684beed09
...
d6cb5fa99b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6cb5fa99b
|
||
|
|
b1ebf5aff2
|
@@ -14,27 +14,28 @@ 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 --option build-hook ""
|
||||||
|
|
||||||
- name: Push to Gitea Registry
|
- name: Push to Gitea Registry
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
REGISTRY="${{ github.server_url }}"
|
||||||
|
REGISTRY="${REGISTRY#https://}"
|
||||||
|
REGISTRY="${REGISTRY#http://}"
|
||||||
|
|
||||||
# Push aarch64 image
|
# Push aarch64 image
|
||||||
skopeo copy \
|
skopeo copy \
|
||||||
--insecure-policy \
|
--insecure-policy \
|
||||||
--dest-creds "${{ github.actor }}:${GITEA_TOKEN}" \
|
--dest-creds "${{ github.actor }}:${GITEA_TOKEN}" \
|
||||||
"docker-archive:./image-aarch64.tar.gz" \
|
"docker-archive:./image-aarch64.tar.gz" \
|
||||||
"docker://${{ github.server_url }}/${{ github.repository }}/node:latest-arm64"
|
"docker://${REGISTRY}/${{ github.repository }}/node:latest-arm64"
|
||||||
|
|
||||||
# Create and push manifest for arm64
|
# Create and push manifest for arm64
|
||||||
skopeo manifest create \
|
skopeo manifest create \
|
||||||
--insecure-policy \
|
--insecure-policy \
|
||||||
--dest-creds "${{ github.actor }}:${GITEA_TOKEN}" \
|
--dest-creds "${{ github.actor }}:${GITEA_TOKEN}" \
|
||||||
"docker://${{ github.server_url }}/${{ github.repository }}/node:latest" \
|
"docker://${REGISTRY}/${{ github.repository }}/node:latest" \
|
||||||
"docker://${{ github.server_url }}/${{ github.repository }}/node:latest-arm64"
|
"docker://${REGISTRY}/${{ github.repository }}/node:latest-arm64"
|
||||||
|
|||||||
54
flake.nix
54
flake.nix
@@ -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"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user