Skip to content

Commit

Permalink
docker/singularity images from nix
Browse files Browse the repository at this point in the history
  • Loading branch information
ekg committed Nov 13, 2023
1 parent 8a59d78 commit 805e196
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,25 @@ If you have `nix`, build and installation in your profile are as simple as:
nix-build && nix-env -i ./result
```

#### Docker and Singularity images with nix

Nix is also able to build an Docker image, which can then be loaded by Docker and converted to a Singularity image.

```
nix-build docker.nix
docker load < result
singularity build wfmash.sif docker-daemon://wfmash-docker:latest
```

This can be run with Singularity like this:

```
singularity run wfmash.sif $ARGS
```

Where `$ARGS` are your typical command line arguments to `wfmash`.


### Bioconda

`wfmash` recipes for Bioconda are available at https://anaconda.org/bioconda/wfmash.
Expand Down
15 changes: 15 additions & 0 deletions docker.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ pkgs ? import <nixpkgs> { }
, pkgsLinux ? import <nixpkgs> { system = "x86_64-linux"; }
}:

let
wfmash = pkgs.callPackage ./wfmash.nix { };
in
pkgs.dockerTools.buildImage {
name = "wfmash-docker";
tag = "latest";
copyToRoot = [ wfmash ];
config = {
Entrypoint = [ "${wfmash}/bin/wfmash" ];
};
}
2 changes: 1 addition & 1 deletion wfmash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
owner = "waveygang";
repo = "wfmash";
rev = "bcfbc14eff4874cda59c66a678fb7d69a31671c5";
sha256 = "sha256-KPjge/83CCj+AXAxQmt0Fsbcy7mNnGzH41l9oiebRPQ=";
sha256 = "sha256-1PNd58O1IjGf+PJPEZttK4S215AEXsI/hKG6kc1inLs=";
};

nativeBuildInputs = [ cmake makeWrapper ];
Expand Down

0 comments on commit 805e196

Please sign in to comment.