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

Cache of /nix only seems to work with docker compose #11

Open
dsyer opened this issue Aug 26, 2022 · 2 comments
Open

Cache of /nix only seems to work with docker compose #11

dsyer opened this issue Aug 26, 2022 · 2 comments

Comments

@dsyer
Copy link

dsyer commented Aug 26, 2022

The example devcontainer.json in the source code use docker compose. It works for me as expected - if I rebuild the container the /nix/store is not downloaded again. If I use the example from the README with "dockerFile": "Dockerfile" etc, then the /nix/store is downloaded on every container startup, even though the same volume is definitely mounted (per docker inspect). Any idea why that is, or what I am doing wrong?

P.S. I love what you did here. I might use a simplified version until I understand what all the moving parts are, but it's all great stuff.

@offlinehacker
Copy link
Contributor

offlinehacker commented Aug 26, 2022

Did you add VOLUME /nix to your Dockerfile, like it's done here https://github.com/xtruder/nix-devcontainer/blob/main/.devcontainer/Dockerfile#L3? I should probably mention it in README or include it into base Dockerfile. Most likely the reason why I didn't do that was because sometimes you don't want to cache /nix and want fresh nix store on every rebuild, but as long I have been using this devcontainer I have always wanted to cache nix store.

PS: Thank you! If you have some suggestions or questions how different parts work together I am open for questions, I might also need to update some parts of README to make things more understandable.

@dsyer
Copy link
Author

dsyer commented Aug 26, 2022

I was using this repo to test and editing only the devcontainer.json. So it has the VOLUME directive for sure.

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

2 participants