-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How to enable buildx when using DinD? #349
Comments
wdym? if you run the docker image as root then home dir is |
@tonistiigi I'm not sure how Gitlab runs the image. But I'm going to try to download and install buildx into root and see if that works. Tried the following: image: docker:19.03.13-beta2
stage: build
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
BUILDX_VERSION: v0.4.1
services:
- name: docker:19.03.13-beta2-dind
command: ["--experimental"]
before_script:
- apk add curl
- mkdir -p /root/.docker/cli-plugins
- curl -sSLo /root/.docker/cli-plugins/buildx https://github.com/docker/buildx/releases/download/$BUILDX_VERSION/buildx-$BUILDX_VERSION.linux-amd64
- chmod +x /root/.docker/cli-plugins/buildx
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker info
script:
- docker buildx But the buildx CLI cmd is still not available. Eventually, after going through the README, I replaced So for others stumbling into the same issue, the following should work: image: docker:19.03.13-beta2
stage: build
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
BUILDX_VERSION: v0.4.1
services:
- name: docker:19.03.13-beta2-dind
command: ["--experimental"]
before_script:
- apk add curl
- mkdir -p ~/.docker/cli-plugins
- curl -sSLo ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/$BUILDX_VERSION/buildx-$BUILDX_VERSION.linux-amd64
- chmod +x ~/.docker/cli-plugins/docker-buildx
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker info
script:
- docker buildx |
This is one of the reasons I created a fork of the official docker image with one that has buildx built in https://hub.docker.com/r/maniator/dind-buildx |
Buildx is available in main docker image now
|
I'm trying to implement a CI pipeline using Docker in Docker on Gitlab. And so far it seem to work, but I was wondering if there's a way to enable the buildx command for the child docker containers.
I can run
docker buildx
on the host, but the child docker containers don't seem to have this.Do I need to manually download the buildx binary? If I do, where should it actually go as there's no home dir to move it to?
NOTE: I'm using the official docker image.
The text was updated successfully, but these errors were encountered: