Skip to content
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

container-driver: fix volume destination for cache #751

Merged
merged 1 commit into from
Aug 28, 2021

Conversation

thaJeztah
Copy link
Member

fixes #749

The container-driver creates a Linux container (as there currently isn't a
Windows version of buildkitd). However, the defaults are platform specific.

Buildx was using the defaults from the buildkit `util/appdefault' package,
which resulted in Buildx running on a Windows client to create a Linux
container that used the Windows location, which causes it to fail:

invalid mount config for type "volume": invalid mount path: 'C:/ProgramData/buildkitd/.buildstate' mount path must be absolute

This patch hard-codes the destination to the default Linux path.

The container-driver creates a Linux container (as there currently isn't a
Windows version of buildkitd). However, the defaults are platform specific.

Buildx was using the defaults from the buildkit `util/appdefault' package,
which resulted in Buildx running on a Windows client to create a Linux
container that used the Windows location, which causes it to fail:

    invalid mount config for type "volume": invalid mount path: 'C:/ProgramData/buildkitd/.buildstate' mount path must be absolute

This patch hard-codes the destination to the default Linux path.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the v0.6.3 milestone Aug 27, 2021
@thaJeztah
Copy link
Member Author

@tonistiigi @crazy-max PTAL

@thaJeztah
Copy link
Member Author

Also wondering if buildx checks if the daemon is running on Linux or Windows (if it's on Windows (native Windows containers) it should not support the container-driver. (or buildkit as a whole, currently)

@zimbres
Copy link

zimbres commented Sep 1, 2021

Hi, Docker 4.0.0 still happening.

PS D:> docker buildx create --name mybuilder --use
mybuilder

PS D:> docker buildx inspect --bootstrap
[+] Building 2.4s (1/1) FINISHED
=> ERROR [internal] booting buildkit 2.4s
=> => pulling image moby/buildkit:buildx-stable-1 2.4s
=> => creating container buildx_buildkit_mybuilder0 0.0s

[internal] booting buildkit:

Name: mybuilder
Driver: docker-container

Nodes:
Name: mybuilder0
Endpoint: npipe:////./pipe/docker_engine
Error: Error response from daemon: invalid mount config for type "volume": invalid mount path: 'C:/ProgramData/buildkitd/.buildstate' mount path must be absolute

PS D:> docker -v
Docker version 20.10.8, build 3967b7d

@thaJeztah
Copy link
Member Author

@zimbres I don't think buildx 0.6.3 was included in Docker Desktop 4.0.0 yet (it will be included in a future patch release), but you can manually install an updated binary release; https://github.com/docker/buildx#binary-release

@zimbres
Copy link

zimbres commented Sep 1, 2021

@thaJeztah thank you! Its correct, buildx was 0.6.1. Running fine after override the buildx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid mount config for type "volume"
3 participants