Skip to content

Commit

Permalink
Generate docker image using flake
Browse files Browse the repository at this point in the history
  • Loading branch information
rien committed Oct 24, 2024
1 parent 63d9322 commit 134d338
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
19 changes: 19 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@
packages = rec {
default = dolos-cli;
dolos-cli = pkgs.callPackage (import ./package.nix) {};
dolos-docker-image = pkgs.dockerTools.buildImage {
name = "ghcr.io/dodona-edu/dolos-cli";
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [ dolos-cli ];
pathsToLink = [ "/bin" ];
};
runAsRoot = ''
mkdir -p /dolos
'';
config = {
Cmd = [ "/bin/dolos" ];
WorkingDir = "/dolos";
};
};
dolos-load-docker = pkgs.writeShellScriptBin "dolos-load-docker" ''
docker load < ${dolos-docker-image}
'';
};
overlays.default = final: prev: {
dolos-cli = final.callPackage (import ./package.nix) {};
Expand Down
20 changes: 18 additions & 2 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,25 @@ buildNpmPackage rec {
pname = "dolos";
version = "2.7.1";

src = ./.;
srcs = [
./package.json
./package-lock.json
./tsconfig.global.json
./core
./parsers
./lib
./web
./cli
];

npmDepsHash = "sha256-qgAdXhohaIyQffkiIWxVXeE3c4JRTgbjxrNFI9dlaNs=";
unpackPhase = ''
for src in $srcs; do
cp -r $src ./$(stripHash $src)
chmod -R 700 ./$(stripHash $src)
done
'';

npmDepsHash = "sha256-XMATCZS/j5bcGjfUQnaFC2mPCv47+3tgIfruTYUQhN4=";

npmWorkspace="cli";

Expand Down

0 comments on commit 134d338

Please sign in to comment.