1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00

feat(ci): Build Docker image via Nix

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel 2024-11-03 08:59:26 +01:00 committed by Steffen Vogel
parent 3ca49fa591
commit 124e59ecc7
2 changed files with 23 additions and 2 deletions

View file

@ -114,8 +114,22 @@ build:nix:
script:
- nix build --print-build-logs .
- nix bundle --out-link villas .
- cp -L villas artifacts/villas
- | # Build ARX bundle
nix bundle --out-link villas .
cp -L villas artifacts/villas
- | # Build Docker image
nix run nixpkgs#skopeo -- login \
--username ${CI_REGISTRY_USER} \
--password ${CI_REGISTRY_PASSWORD} \
${CI_REGISTRY}
nix build '.#dockerImage'
nix run nixpkgs#skopeo -- copy --insecure-policy \
"docker-archive:./result" \
"docker://${DOCKER_IMAGE}:${DOCKER_TAG}-nix"
# after_script:
# - | # Push whole store to cache

View file

@ -63,6 +63,13 @@
withAllHooks = true;
withAllNodes = true;
};
dockerImage = pkgs.dockerTools.buildLayeredImage {
name = "villas-node";
tag = "latest-nix";
contents = [ villas-node ];
config.ENTRYPOINT = "/bin/villas";
};
};
in
{