Docker build does not work
Description
Whenever i try to use docker build it is referencing buildx, and this is not at all what i expect.
Specifically:
❯ docker build
docker: 'buildx' is not a docker command.
See 'docker --help'
likewise it seems like docker does not recognize build as a sub command even though the help text states it is a command:
❯ docker build --help
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Common Commands:
run Create and run a new container from an image
exec Execute a command in a running container
ps List containers
build Build an image from a Dockerfile
pull Download an image from a registry
push Upload an image to a registry
images List images
login Log in to a registry
logout Log out from a registry
search Search Docker Hub for images
version Show the Docker version information
info Display system-wide information
...
I would here expect the docker build help text to appear.
Reproduce
- docker build
Expected behavior
docker build works as expected and builds a docker image.
docker version
Client:
Version: 26.1.3
API version: 1.45
Go version: go1.22.3
Git commit: v26.1.3
Built: Thu Jan 1 00:00:00 1970
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 26.1.3
API version: 1.45 (minimum version 1.24)
Go version: go1.22.3
Git commit: v26.1.3
Built: Tue Jan 1 00:00:00 1980
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.7.16
GitCommit: v1.7.16
runc:
Version: 1.1.12
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
docker info
Client:
Version: 26.1.3
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.14.0
Path: /nix/store/jidnm42865p7pisj8i7nils91ianj19f-docker-plugins/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: 2.27.0
Path: /nix/store/jidnm42865p7pisj8i7nils91ianj19f-docker-plugins/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 25
Running: 0
Paused: 0
Stopped: 25
Images: 84
Server Version: 26.1.3
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: v1.7.16
runc version:
init version:
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.90
Operating System: NixOS 24.11 (Vicuña)
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 62.61GiB
Name: kbnuxfrm101
ID: a05398bb-a84c-4d52-a903-9024c8cfb504
Docker Root Dir: /var/lib/docker
Debug Mode: false
Username: jchb
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: true
Additional Info
Other docker commands looks like they are working as i would expect.
I can't reproduce this issue on our official packages: https://docs.docker.com/engine/install/ We don't maintain the NixOS packages and it looks like it might be a packaging issue - please report it on the nixpkgs issue tracker.
Also worth noting that I see it's compiled with go1.22, and at least runc is NOT compatible with go1.22 currently; it may compile, but there may be issues.
I also experienced the same problem on RHEL/UBI. It turned out I had disabled installing weak dependencies (i.e. recommended packages), and this prevented the docker-buildx-plugin from installing when installing docker-ce-cli. If you need to disable weak dependencies, then you'll need to manually install docker-buildx-plugin.
closing as I don't think there's anything actionable here