diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2adc72cc5..3c2bf76e1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/flake.nix b/flake.nix index 602a3481f..26f06f73e 100644 --- a/flake.nix +++ b/flake.nix @@ -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 {