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

Support flake #4

Merged
merged 1 commit into from
Dec 28, 2021
Merged

Support flake #4

merged 1 commit into from
Dec 28, 2021

Conversation

AkihiroSuda
Copy link
Member

See examples/nginx-flake/flake.nix

Fix #1

Thanks to @tomberek for providing hints.

See `examples/nginx-flake/flake.nix`

Fix issue 1

Thanks to [@]tomberek for providing hints.

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda AkihiroSuda mentioned this pull request Dec 28, 2021
@AkihiroSuda AkihiroSuda merged commit 85458a3 into master Dec 28, 2021
@tomberek
Copy link

tomberek commented Dec 28, 2021

I'm getting a permission denied during build regarding etc/group

docker-layer-nginx> Adding contents...
docker-layer-nginx> Adding /nix/store/94mnvdilyq5g6v5i6s4fj3a6bfd02rpp-fake-nss
docker-layer-nginx> Adding /nix/store/l0wlqpbsvh1pgvhcdhw7qkka3d31si7k-bash-5.1-p8
docker-layer-nginx> Adding /nix/store/fvprxgcxf4px865gdjd81fbwnxcjrg41-coreutils-9.0
docker-layer-nginx> Adding /nix/store/iscr1m6s6sakm3jqy2sc45ff6p601wvx-nginx-1.20.2
docker-layer-nginx> Adding /nix/store/l7vzwf13ls7969r5fvx36py9yx29k2bg-index.html
docker-layer-nginx> /build/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 16: etc/group: Permission denied

@AkihiroSuda AkihiroSuda deleted the dev branch December 28, 2021 06:35
@AkihiroSuda
Copy link
Member Author

@tomberek Could you open an issue with docker info and docker version?

Does docker builder prune help?

@AkihiroSuda
Copy link
Member Author

Or, maybe you are trying to nix build the image without using docker build?

Then you need --option build-users-group ""

	var nixBuildCmd *exec.Cmd
	if flakeMode {
		nixBuildCmd = exec.CommandContext(ctx,
			"nix",
			"--extra-experimental-features", "nix-command",
			"--extra-experimental-features", "flakes",
			"build",
			"--option", "build-users-group", "",
			"/dockerfile",
		)
	} else {
		nixBuildCmd = exec.CommandContext(ctx, "nix-build", "--option", "build-users-group", "", fullFilename)
	}

@AkihiroSuda
Copy link
Member Author

Opened PR #7 for improving nix build compatibility

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

Successfully merging this pull request may close these issues.

Flakes support
2 participants