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

Provide Dockerfile target for pre-cached vm & vm-rootless #122

Merged
merged 2 commits into from
Feb 18, 2024

Conversation

elpdt852
Copy link
Collaborator

This will let users without Nix to try out nix-snapshotter with just:

# Entrypoint launches directly into `.#vm` QEMU
docker run --rm -it ghcr.io/pdtpartners/nix-snapshotter

# Entrypoint launches directly into `.#vm-rootless` QEMU
docker run --rm -it ghcr.io/pdtpartners/nix-snapshotter:rootless

I'm not adding a CD target atm because this requires a docker builder, and a rather long build without caching capability. Though not impossible because I believe buildkit allows you to store caches in an OCI image, so we may be able to push it to ghcr.io.

@elpdt852 elpdt852 added the ok-to-test Runs NixOS tests label Feb 18, 2024
Copy link
Collaborator

@RobbieBuxton RobbieBuxton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one thing I've been wondering, which is a bit unrelated but is there any particular reason why throughout the repo we are using/recommending nix run ".#vm" as opposed to nix run .#vm. e.g in this pr "#nixosConfigurations.vm.config.system.build.vm" instead of .#nixosConfigurations.vm.config.system.build.vm .
From my understanding the quotation marks aren't necessary as long as you include a period before?

@elpdt852
Copy link
Collaborator Author

elpdt852 commented Feb 18, 2024

In some shells like zsh in certain modes, the # means something special to the shell so it actually errors. Wrapping it in quotes ensures it works across all shells.

See: NixOS/nix#4686

@elpdt852 elpdt852 merged commit 5ee3dc3 into main Feb 18, 2024
5 checks passed
@elpdt852 elpdt852 deleted the feature/vm-dockerfile branch February 18, 2024 14:05
@RobbieBuxton
Copy link
Collaborator

In some shells like zsh in certain modes, the # means something special to the shell so it actually errors. Wrapping it in quotes ensures it works across all shells.

See: NixOS/nix#4686

Makes sense, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Runs NixOS tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants