rmihaly
9
Found it! Permissions!
Here is what happens:
$ sudo chmod 750 /usr/local/libexec
$ docker build
docker: 'buildx' is not a docker command.
See 'docker --help'
$ sudo chmod 755 /usr/local/libexec
$ 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
It seems that docker will iterate through the configured plugin libraries in a certain order and it checks /usr/local/lib and /usr/local/libexec before /usr/lib and /usr/libexec which is correct. But there seems to be lack of error handling when a directory does not have the proper permissions. If the user running docker has no permission to access the /usr/local/libexec folder, Docker fails to search the remaining locations and will not find the plugins.
My issue was that /usr/local/libexec had permissions 750, while it didn’t contain any docker/cli-plugins folder, Docker failed on this and did not check further for plugins under /usr/libexec even though that directory had the correct permissions. When I was poking around and testing whether /usr/local/libexec/docker/cli-plugins will work, I fixed the permissions and then everything started to work.
I think, this is a bug in docker-cli, unrelated to Fedora. The permissions on /usr/local/libexec was probably due to me creating that folder with default umask 027 and forgetting about changing it later.