-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
docker-buildx: init at 0.5.1 #107302
docker-buildx: init at 0.5.1 #107302
Conversation
This change requires the following in {
"experimental": "enabled",
"cliPluginsExtraDirs": [
"/Users/ivan/.nix-profile/libexec/docker/cli-plugins"
]
} Here Ideally I'd like it to work outside of the box, but even the following patch doesn't do the trick: I'd love some pointers on how things like that are supposed to work with Nix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to nixpkgs! :)
Since you are adding yourself as a maintainer, this is typically done in two separate commits:
- add yourself to the maintainer-list
- add the package, with yourself as a maintainer
I'm not sure how the plugin automation would work on darwin - there might be issues with purity: LnL7/nix-darwin#112
If you'd like to set it up on NixOS though, that should be possible by modifying nixos/modules/virtualisation/docker.nix
.
1174d8c
to
6a8bed7
Compare
I've split my changes into two commits as requested. Not sure if LnL7/nix-darwin#112 is relevant here, since I'm adding |
Hm you are right I thought there was some mention of config.json issues there. I'm surprised the buildx command doesn't just work - e.g. for git-lfs it's just a separate binary that shows up as a subcommand along with the other git-* binaries. Does buildx need extra setup? |
In Git's case it's a matter of running
With Docker it tries to look up the binary in the list of hardcoded (+configured) paths: And |
Well I think checking only the nix-profile might run into issues with nix-shell or system installations - can docker consume a list of plugin directories from e.g. an environment variable? If not, how about something like |
I managed to add With the following in my {
packageOverrides = pkgs: {
docker = pkgs.docker.override { buildxSupport = true; };
};
} Building docker from my local copy of
Produces the
With the only caveat that user has to enable experimental features in {
"experimental": "enabled"
} |
cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice approach 👍
One caveat of this over something like withPlugins
is that you'll have to rebuild all of docker when you ask for buildx support, rather than just the wrapper. But if there's no way to specify the plugin dirs at runtime, I guess this is unfortunately unavoidable.
An alternative interface for the override could be to accept a list of plugins to add to the search path, but if buildx is the only plugin we need to care about right now, then a simple boolean toggle is probably more straightforward.
3e7a4b3
to
3b03001
Compare
@r-burns, I amended my commits with your changes 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, nice work 👍
I'd like a second opinion from one of the docker package maintainers, but this all looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐯
3b03001
to
d58fead
Compare
Is there anything else I should do to get this merged? |
/marvin opt-in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I can tell the diff LGTM
This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch) Result of 1 package built:
|
This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch) Result of 1 package built:
|
Any reason not to merge? |
The merge conflict and the thins I noted above. |
d58fead
to
772ca1e
Compare
Rebased on top of the latest master branch. |
772ca1e
to
1386da2
Compare
1386da2
to
f7bcc99
Compare
Installing docker-buildx enables buildx subcommand on the client: * https://github.com/docker/buildx
f7bcc99
to
deb0d29
Compare
Resolved conflicts by rebasing once again. |
This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch). Result of 1 package built:
|
Small correction was needed after a rebase: #110543. |
Motivation for this change
Installing docker-buildx enables buildx subcommand on the client:
Things done
sandbox
innix.conf
on non-NixOS linux)nixos/nix
docker image (aarch64)./result/bin/
)nix path-info -S
before and after)