Skip to content

buildx is not a docker command on linux/amd64 ? #132

Closed
@pujag-xlnx

Description

@pujag-xlnx

Hi,
I have docker 19.03 on ubuntu amd64 and I tried the steps in your readme but fail to get buildx command working. It complains command not found. What do I need to get it working? I tried beta release as well and same issue. I am looking to compile images for arm64.

Appreciate the help a lot,
Puja
$ cat ~/.docker/config.json
{
"experimental": "enabled"
}
$ ls -l ~/.docker/cli-plugins/docker-buildx
total 55936
drwxr-xr-x 2 pujag newhiredefaultgrp 4096 Aug 12 14:05 .
drwxr-xr-x 3 pujag newhiredefaultgrp 4096 Aug 12 14:01 ..
-rwxr-xr-x 1 pujag newhiredefaultgrp 57036919 Aug 12 14:04 buildx-v0.2.0.linux-amd64
$ docker version
Client: Docker Engine - Community
Version: 19.03.1
API version: 1.40
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:21:05 2019
OS/Arch: linux/amd64
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 19.03.1
API version: 1.40 (minimum version 1.12)
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:19:41 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.6
GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc:
Version: 1.0.0-rc8
GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f
docker-init:
Version: 0.18.0
GitCommit: fec3683

Activity

FernandoMiguel

FernandoMiguel commented on Aug 14, 2019

@FernandoMiguel
Contributor

I've had happen before since ~/.docker/cli-plugins/docker-buildx is mot in $PATH
you can manually run that to install it.
Or straight away refer to it for execution (that's what I personally do)
If you find the right steps to enable it as drop in, a PR to update the docs would be appreciated

FernandoMiguel

FernandoMiguel commented on Aug 14, 2019

@FernandoMiguel
Contributor

BTW, that's the old release, consider upgrading to 0.3 which has nice additions.
I believe that the nightly builder have been broken since last docker release, so no new version has been pushed

pujag-xlnx

pujag-xlnx commented on Aug 14, 2019

@pujag-xlnx
Author

Thank you so much for the reply. Works for me now. Path issues. Yes will update, I see newer version now.

pujag-xlnx

pujag-xlnx commented on Aug 14, 2019

@pujag-xlnx
Author

How can I compile images for arm64 embedded on my amd64 linux machine? Buildx lists only linux/amd64 in platforms for me. I had downloaded buildx-3.0-amd64 and saved it as docker-buildx in cli-plugins. is that the right way to do it?

$ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
mybuilder * docker-container
mybuilder0 unix:///var/run/docker.sock running linux/amd64, linux/386
default docker
default default running linux/amd64

tonistiigi

tonistiigi commented on Aug 15, 2019

@tonistiigi
Member

docker-buildx doesn't need to be on $PATH but ~/.docker/cli-plugins/docker-buildx is the binary itself, not a directory containing the binary.

If you don't use Docker Desktop you need to set up qemu support in your kernel yourself and buildx will pick it up on bootstrap. You can use https://github.com/multiarch/qemu-user-static#getting-started or https://hub.docker.com/r/docker/binfmt/tags images to install the emulation support.

pujag-xlnx

pujag-xlnx commented on Aug 16, 2019

@pujag-xlnx
Author

Thanks @tonistiigi . Yes I had created a directory instead of file, works perfect now.

Thanks for the link, so if I understand it right qemu-user-static seems to be useful if I wanted to run arm64 image on host x86, but if I just wanted to create arm64 image on host x86 and run on embedded arm64 I might not need qemu-user-static?

tonistiigi

tonistiigi commented on Aug 16, 2019

@tonistiigi
Member

@gupta05 If your Dockerfile needs to execute RUN commands for another architecture you need to load the qemu-user-static support to kernel before. If you only use other commands you can build directly for any platform.

yxliang01

yxliang01 commented on Sep 15, 2019

@yxliang01

Docker-ce CLI 19.03.2 , git commit 6a30dfca03 , experimental enabled . docker buildx yields 'buildx' is not a docker command. Does this suggest that buildx is not bundled for docker-ce CLI 19.03 (that the README.md is wrong) ?

FernandoMiguel

FernandoMiguel commented on Sep 15, 2019

@FernandoMiguel
Contributor

@yxliang01 do you have the plugin installed?

yxliang01

yxliang01 commented on Sep 15, 2019

@yxliang01

@FernandoMiguel I didn't install myself because in the README.md of this repo, it says buildx is bundled with docker 19.03, right? So, I wouldn't expect the need to install it manually. See https://github.com/docker/buildx/blob/master/README.md#docker-ce .

FernandoMiguel

FernandoMiguel commented on Sep 15, 2019

@FernandoMiguel
Contributor

@yxliang01 I always found I had to either install it or include it in the $PATH

darkvertex

darkvertex commented on Sep 17, 2019

@darkvertex

@FernandoMiguel I didn't install myself because in the README.md of this repo, it says buildx is bundled with docker 19.03, right? So, I wouldn't expect the need to install it manually. See https://github.com/docker/buildx/blob/master/README.md#docker-ce .

Did you add "experimental": "enabled" in your ~/.docker/config.json?

29 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @djmaze@FernandoMiguel@admackin@arruda@vojkny

      Issue actions

        buildx is not a docker command on linux/amd64 ? · Issue #132 · docker/buildx