nix-kubernetes icon indicating copy to clipboard operation
nix-kubernetes copied to clipboard

Containers specified as dockerTools images?

Open copumpkin opened this issue 8 years ago • 3 comments

Is it possible to be Nix from start to finish and specify my container images using dockerTools instead of talking about images from a pre-existing registry? That would be amazing!

copumpkin avatar Jan 06 '17 02:01 copumpkin

Currently not, but I was thinking about having pre-deployment "hooks", that upload docker image or nix store(distributed nix store) somewhere. While in our case this is not as useful, as we have build process separated from provisioning, I understand the use case, where you let Hydra build everything and then you have one large closure of everything you need for running apps on your cluster.

On Fri, Jan 6, 2017, 3:32 AM Daniel Peebles [email protected] wrote:

Is it possible to be Nix from start to finish and specify my container images using dockerTools instead of talking about images from a pre-existing registry? That would be amazing!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/proteuslabs/nix-kubernetes/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjvSzCmoMGwLPWy0gNraExhZC-hQt6Bks5rPafPgaJpZM4LcWId .

offlinehacker avatar Jan 06 '17 09:01 offlinehacker

Yeah, that would be amazing.

On Jan 6, 2017, at 04:28, Jaka Hudoklin [email protected] wrote:

Currently not, but I was thinking about having pre-deployment "hooks", that upload docker image or nix store(distributed nix store) somewhere. While in our case this is not as useful, as we have build process separated from provisioning, I understand the use case, where you let Hydra build everything and then you have one large closure of everything you need for running apps on your cluster.

On Fri, Jan 6, 2017, 3:32 AM Daniel Peebles [email protected] wrote:

Is it possible to be Nix from start to finish and specify my container images using dockerTools instead of talking about images from a pre-existing registry? That would be amazing!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/proteuslabs/nix-kubernetes/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjvSzCmoMGwLPWy0gNraExhZC-hQt6Bks5rPafPgaJpZM4LcWId .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

copumpkin avatar Jan 06 '17 15:01 copumpkin

I've put together an example of how one might go about adding dockerTools images to a configuration.

It has the following files:

  • trivial.nix: adaptation of the preexisting example
  • myImages.nix: defines the images with dockerTools
  • images.nix: indirection for images, should become part of nix-kubernetes
  • nixImages.nix: module that maps dockerTools images onto the images config, should become part of nix-kubernetes

The only thing missing is upload to registry. I like @offlinehacker's suggestion of providing a hook. We can make the upload strategy pluggable by letting the user import the right module for it. Such a module could be provided by nix-kubernetes or the user. For the user, that might look like this in the future:

 imports = [ <nix-kubernetes/upload/gcr.nix> ];
 config.upload.gcr.foo = true;

An upload module simply reads the nixImages config and sets the upload hook to an appropriate script.

What do you think?

roberth avatar Mar 05 '18 09:03 roberth