commit
e72af62aa2
15 changed files with 54 additions and 28 deletions
|
@ -88,6 +88,15 @@ All images are automatically built and pushed to Docker Hub.
|
|||
| [nixpkgs/nix](https://hub.docker.com/r/nixpkgs/nix) |  |  |
|
||||
| [nixpkgs/nix-unstable](https://hub.docker.com/r/nixpkgs/nix-unstable) |  |  |
|
||||
|
||||
## Adding new images
|
||||
|
||||
To add a new image to the project, create a new folder under
|
||||
`./images/<image-name>` with a default.nix that returns the docker image.
|
||||
|
||||
Then run `nix-build release.nix -A <image-name>` to test that it builds, and
|
||||
then use
|
||||
`docker load -i /nix/store/...<image-name>.tar.gz` to load and test the image.
|
||||
|
||||
## Related projects
|
||||
|
||||
The [docker-library](https://github.com/docker-library/official-images#readme)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{ buildCLIImage
|
||||
, docker-compose
|
||||
}:
|
||||
buildCLIImage {
|
||||
drv = docker-compose;
|
||||
}
|
11
images/docker-compose/default.nix
Normal file
11
images/docker-compose/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ buildCLIImage
|
||||
, docker-compose ? null
|
||||
, python3Packages
|
||||
}:
|
||||
buildCLIImage {
|
||||
drv =
|
||||
if docker-compose == null
|
||||
then python3Packages.docker_compose
|
||||
else docker-compose # nixos 19.03+
|
||||
;
|
||||
}
|
6
images/nix-unstable/default.nix
Normal file
6
images/nix-unstable/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ docker-nixpkgs
|
||||
, nixUnstable
|
||||
}:
|
||||
docker-nixpkgs.nix.override {
|
||||
nix = nixUnstable;
|
||||
}
|
21
lib/importDir.nix
Normal file
21
lib/importDir.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ lib }:
|
||||
|
||||
importFn: baseDir:
|
||||
let
|
||||
dirEntries =
|
||||
builtins.attrNames
|
||||
(lib.filterAttrs
|
||||
(k: v: v == "directory")
|
||||
(builtins.readDir baseDir));
|
||||
|
||||
absDirs =
|
||||
builtins.map
|
||||
(dir: "${toString baseDir}/${dir}")
|
||||
dirEntries;
|
||||
|
||||
imports =
|
||||
builtins.map
|
||||
(dir: { name = builtins.baseNameOf dir; value = importFn dir; })
|
||||
absDirs;
|
||||
in
|
||||
builtins.listToAttrs imports
|
29
overlay.nix
29
overlay.nix
|
@ -1,26 +1,11 @@
|
|||
_: pkgs: {
|
||||
# lib stuff can be in the top-level
|
||||
_: pkgs: let
|
||||
importDir = import ./lib/importDir.nix {
|
||||
inherit (pkgs) lib;
|
||||
};
|
||||
in {
|
||||
# builder stuff can be in the top-level
|
||||
buildCLIImage = pkgs.callPackage ./lib/buildCLIImage.nix {};
|
||||
|
||||
# docker images must be lower-cased
|
||||
docker-nixpkgs = rec {
|
||||
|
||||
bash = pkgs.callPackage ./bash {};
|
||||
busybox = pkgs.callPackage ./busybox {};
|
||||
curl = pkgs.callPackage ./curl {};
|
||||
docker-compose = pkgs.callPackage ./docker-compose {
|
||||
docker-compose =
|
||||
# master
|
||||
pkgs.docker-compose or
|
||||
# 18.09 or later
|
||||
pkgs.python3Packages.docker_compose;
|
||||
};
|
||||
kubectl = pkgs.callPackage ./kubectl {};
|
||||
kubernetes-helm = pkgs.callPackage ./kubernetes-helm {};
|
||||
nix = pkgs.callPackage ./nix {};
|
||||
nix-unstable = nix.override {
|
||||
nix = pkgs.nixUnstable;
|
||||
};
|
||||
|
||||
};
|
||||
docker-nixpkgs = importDir (path: pkgs.callPackage path {}) ./images;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue