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

RUN --mount=type=bind doesn't work #1226

Open
shollander opened this issue Nov 4, 2024 · 5 comments
Open

RUN --mount=type=bind doesn't work #1226

shollander opened this issue Nov 4, 2024 · 5 comments

Comments

@shollander
Copy link

Expected Behavior

Use RUN --mount=type=bind to install dependencies in efficient manner. e.g. Dockerfile:

FROM python:3.12-slim
RUN --mount=type=bind,source=myapp,target=/tmp/myapp pip install /tmp/myapp

Current Behavior

Fails with the following error:

Could not build image: the --mount option requires BuildKit. Refer to https://doc.docker.com/go/buildkit ro learn how to build images with BuildKit enabled

Context

This Dockerfile works fine with command line docker build .

@bmuschko
Copy link
Owner

bmuschko commented Nov 7, 2024

The Docker remote API does not support buildkit as of now.

@shollander
Copy link
Author

I'm not sure what you mean by that. According to the Docker documentation, it appears that the remove driver does support BuildKit.

@bmuschko
Copy link
Owner

We are not using the Docker executable with this plugin. We are using the RESTful API.

@shollander
Copy link
Author

It looks to me like the RESTful API does support BuildKit.

The imageBuild API has a parameter called version that should be set to 2 to use BuildKit.

@bmuschko
Copy link
Owner

OK, seems like Docker added that to the API recently. Unfortunately, Docker Java, the wrapper around the Docker API, does not support it yet: docker-java/docker-java#2362

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

No branches or pull requests

2 participants