Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.49 KB

README.md

File metadata and controls

45 lines (35 loc) · 1.49 KB

What is this?

This is a docker registry, i.e. you can pull images from this registry with e.g. docker run or in kubernetes.

This registry builds images on-the-fly based on a nix expression found in a public or private repository.

I first explored this idea here and there is also nixery, a slightly different take on the same idea.

Configuration

The service needs:

  1. A directory to store layer blobs
  2. A directory to cache git clone output
  3. A set of repository descriptions

The invocation looks e.g. like this:

 nixcr \
     --blob-root /tmp/blob-cache/ \
     --repo-root /tmp/repo-cache/ \
     # public repo:
     --repo nixpkgs,https://github.com/NixOS/nixpkgs \
     #      ^^^^^^^ lookup key
     #              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ repository for that key
     # private repo:
     --repo nixcr,[email protected]:private/private.git,/keys/id_rsa
     #      ^^^^^ lookup key
     #            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ repository for key
     #                                               ^^^^^^^^^^^^ path to private ssh deploy key

For the example above you could do e.g.

docker run -it 127.0.0.1:8888/nixpkgs/cafe1111:hello
        #      ^^^^^^^^^^^^^^ host + port where nixcr is running
        #                    ^^^^^^^^ lookup key (see above)
        #                             ^^^^^^^^ commit
        #                                      ^^^^^ nix attribute path