NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.39k stars 14.34k forks source link

Docker build does not work #317765

Open Spatenheinz opened 5 months ago

Spatenheinz commented 5 months ago

Describe the bug

I cannot use docker build. It was not a problem before I upgraded to 24.11.20240529.ad57eef (Vicuña) Now it references build wrong. Running the following:

❯ docker build
docker: 'buildx' is not a docker command.
See 'docker --help'

This is indeed wrong, and I guess there might be something wrong with the nix package.

Steps To Reproduce

Steps to reproduce the behavior:

  1. docker build

Expected behavior

docker build to work.

Screenshots

Additional context

my issue @ docker: https://github.com/docker/cli/issues/5124

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.90, NixOS, 24.11 (Vicuña), 24.11.20240529.ad57eef`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/vsbi6gfwf2bdamw0d0d9xndb1rrxfnbk-source`

Add a :+1: reaction to issues you find important.

RossComputerGuy commented 5 months ago

For me, I see docker build does docker buildx build on NixOS 24.05 (aarch64-linux).

$ docker build
ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build
Spatenheinz commented 5 months ago

Do you know why that is? It seems like a poor choice to "override" a common command. It looks like it is also broken on 23.11 but not on 23.05. I will look into where this aliasing occurs, when time allow it.

RossComputerGuy commented 5 months ago

Do you know why that is?

Docker in nixpkgs is built with docker-buildx support

It seems like a poor choice to "override" a common command.

Not an override, it's an official plugin.

Spatenheinz commented 5 months ago

Well poor choice of words by me. I wanted to say alias. docker build and docker buildx is not the same thing. I don't care for the docker-buildx extension and to me it seems like the default build command is unreachable. Is this always the case for docker (not only nix), I don't think so, but might be wrong.