Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker setup #15

Open
5 tasks
DanielFabian opened this issue Jan 27, 2020 · 3 comments
Open
5 tasks

Add docker setup #15

DanielFabian opened this issue Jan 27, 2020 · 3 comments

Comments

@DanielFabian
Copy link

Hello,

I'm trying to figure out if there's a docker image with this. My background being, that I'm considering to set up a binary cache and because it would be an internal project, I don't want to use cachix. From what I gather, it should be fairly straight-forward to set up and I'm happy to do the work if it doesn't exist yet.

Could you please provide me with some guidance how to go about it in the most fruitful way?

From what I gather, there is no real nixos docker base image, correct? So the steps I see necessary, it would be:

  • start with the nix base image
  • install nix-serve
  • set up nginx
  • manually start nix-serve and nginx inside the container
  • add the Dockerfile to this repo?

A bit of help would be appreciated.

@lheckemann
Copy link

You can build a docker image with nix, which is probably better than using a Dockerfile. However, neither this nor the dockerfile approach will allow you to actually upload paths. You may prefer an nginx serving files from a static folder which you fill using nix copy.

@pinpox
Copy link

pinpox commented Mar 24, 2021

@lheckemann Could you elaborate on that? I've setup a cache with nix-serve, but I'm concerned about using the host's nix-store for it. Is it possible to have a separate store that is just for the cache?

How can nginx serving static files be a valid cache, is the nix caching mecahnism that simple?

@lheckemann
Copy link

Yes, a binary cache consists of a bunch of .narinfo files which contain some metadata (including signatures) on paths and .nar files representing the actual contents of the store paths. You can create one using e.g. nix build nixpkgs.hello && nix copy ./result --to /var/www/nix-cache and serving /var/www/nix-cache via nginx or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants