-
Notifications
You must be signed in to change notification settings - Fork 494
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
Creating a build context with a specific platform #151
Comments
:: sigh :: Ok - ignore me. I'd not noticed the docker version on the pi was still 18.09 and didn't have buildx at all. Updated to 19.03 and put the buildx binary in place and it seems to do The Right Thing(tm). Sorry! |
Actually - I'm still seeing the same thing and it doesn't seem to be using the pi to build the arm image. I have :
If I kick off a build using
Which made me think all was well. But the image still seems to be building on the local mac. The system load on the pi stays down at about 0, while the mac's disk thrashes away even though the amd64 part is done and it's still building the arm/v7 one. If only build with |
@ohnotnow As you see your local Btw, you don't need to install buildx/19.03 on the rpi for this to work. |
@tonistiigi ahh! Yep - specifying the platform as linux/arm/v7 when appending the rpi node worked perfectly! Thank you! Just for anyone else who ends up here and is trying the same thing, my process was (shortened!) :
|
I believe this should be opened? Check current status: $ docker buildx create --append --name farm --platform linux/amd64 ssh://kaszpir@nyx-m6v
farm
$ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
farm * docker-container
farm0 hormes running linux/arm/v7, linux/arm/v6
farm1 ssh://kaszpir@nyx-m6v running linux/amd64, linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
hormes docker
hormes hormes running linux/arm/v7, linux/arm/v6
nyx docker
nyx nyx running linux/amd64, linux/386
default docker
default default running linux/amd64, linux/386
$ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
farm docker-container
farm0 hormes running linux/arm/v7, linux/arm/v6
farm1 ssh://kaszpir@nyx-m6v running linux/amd64, linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
hormes docker
hormes hormes running linux/arm/v7, linux/arm/v6
nyx docker
nyx nyx Cannot connect to the Docker daemon at http://docker. Is the docker daemon running?: driver not connecting
default * docker
default default running linux/amd64, linux/386 Let's add node or let's try to alter its platform: $ docker buildx create --name farm --node farm1 --platform linux/amd64 ssh://kaszpir@nyx-m6v
farm
$ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
farm docker-container
farm0 hormes running linux/arm/v7, linux/arm/v6
farm1 ssh://kaszpir@nyx-m6v running linux/amd64, linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
hormes docker
hormes hormes Cannot connect to the Docker daemon at http://docker. Is the docker daemon running?: driver not connecting
nyx docker
nyx nyx running linux/amd64, linux/386
default * docker
default default running linux/amd64, linux/386
$ docker buildx create --name farm --node farm1 --platform linux/amd64
farm
$ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
farm docker-container
farm0 hormes running linux/arm/v7, linux/arm/v6
farm1 ssh://kaszpir@nyx-m6v running linux/amd64, linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
hormes docker
hormes hormes Cannot connect to the Docker daemon at http://docker. Is the docker daemon running?: driver not connecting
nyx docker
nyx nyx Cannot connect to the Docker daemon at http://docker. Is the docker daemon running?: driver not connecting
default * docker
default default running linux/amd64, linux/386 Lets add it as context $ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock https://127.0.0.1:6443 (default) swarm
hormes rpi direct ssh://pi@hormes
nyx nyx ssh://kaszpir@nyx-m6v
$ docker buildx create --name farm --node farm1 --leave
farm
$ docker buildx create --append --name farm --node farm1 --platform linux/amd64 nyx
farm
$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock https://127.0.0.1:6443 (default) swarm
hormes rpi direct ssh://pi@hormes
nyx nyx ssh://kaszpir@nyx-m6v
22:14:41 kaszpir@misiek ~/src/docker-multiarch $ docker buildx ls
WARN[0007] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0007] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0007] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0007] commandConn.CloseRead: commandconn: failed to wait: signal: killed
WARN[0007] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0017] commandConn.CloseWrite: commandconn: failed to wait: exec: Wait was already called
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
farm docker-container
farm0 hormes running linux/arm/v7, linux/arm/v6
farm1 nyx running linux/amd64, linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
hormes docker
hormes hormes running linux/arm/v7, linux/arm/v6
nyx docker
nyx nyx Cannot connect to the Docker daemon at http://docker. Is the docker daemon running?: driver not connecting
default * docker
default default running linux/amd64, linux/386 Notice that the auto-added builders from contexts also have issues with the status command (hormes/hormes or nyx/nyx), while when they are added as contexts are displayed okay (farm/farm0 and farm/farm1). |
Manual and detected platforms are merged together and have a preference priority. Showing duplicate values is a bug and should be fixed. |
After some tests the platform preference indeed works, although the $ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
farm * docker-container
farm0 hormes running linux/arm/v7, linux/arm/v6, linux/arm/v7, linux/arm/v7, linux/arm/v6
farm1 nyx running linux/amd64, linux/arm64, linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
hormes docker
hormes hormes running linux/arm/v7, linux/arm/v6
nyx docker
nyx nyx running linux/amd64, linux/386
default docker
default default running linux/amd64, linux/386 $ docker buildx inspect
Name: farm
Driver: docker-container
Nodes:
Name: farm0
Endpoint: hormes
Status: running
Platforms: linux/arm/v7, linux/arm/v6
Name: farm1
Endpoint: nyx
Status: running
Platforms: linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
|
Hi,
I'm trying to set up a build context that uses my local machine (mac) for the amd64 builds and a raspberry pi for the arm/v7 ones. So I do :
So the mybuilder0 has picked up all the other platforms - so if I specify a
--platform=linux/arm/v7
on the build it seems to use the local mybuilder0 rather than the raspberry pi.I'm not sure if there's a work-around for that, or if I'm doing something wrong. Probably the latter ;-)
Docker version is 19.03.2, build 6a30dfc.
The text was updated successfully, but these errors were encountered: