-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support BuildKit #2230
Comments
The current known blocker for this is we need a Python implementation of the |
Request for build secret support: #2174 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
In addition to As @mipearson commented in moby/buildkit#685 , docker-py should just invoke |
My recommendation is to create a helper binary that compose can call as a quick practical solution. Note that |
Do we need a helper binary other than existing docker CLI? |
There are some things that might be interesting for compose that can be done in Go library and not in CLI atm. Like doing multiple requests in parallel with a shared session. |
Is there a possible future where most docker-compose things are done via a helper binary rather than via docker-py? I seem to be having a very bad run of hitting docker-py specific issues lately :( |
Is this something people are working on? It sounds like a direction hasn't really even been picked yet. |
I have chosen to work around the lack of buildkit support by just calling the docker-cli in my projects. It works pretty well for me.
|
Same here. |
I think that's what we're all doing, but it means that docker-compose is basically a nonentity at this point, and frankly docker-compose is much easier to use when setting up test environments. It's really unfortunate that such a useful tool is no longer usable due to this issue, and that there doesn't seem to be any timeline for resolving it (at this point I'm assuming docker compose will only get buildkit functionality when it becomes the default option). |
There is an |
That PR has now been closed, and a new one opened: docker/compose#6865 |
Any deadline to release this feature and make it GA ? I am switching back to docker build which is very bad. |
for all the folks here |
Any update? |
docker/compose#6865 got merged I suggest closing this issue |
How docker/compose is connected to docker/docker-py? |
docker/compose is the most widely known consumer of docker/docker-py. |
Then what the point of whole 'docker-py' if all projects have to switch to use Docker cli? Your comment suggest "abandon all hope, forget about docker-py, use cli directly'. |
Hi @hrw, We'd gladly accept PRs for this and would help where possible. Note that this is tricky because of the issue mentioned above. For Compose, the decision was taken to use the Docker CLI for build as it's unlikely someone will have Compose but not the CLI. |
BTW our group needs this as well. Mainly we need the |
BuildKit is the default builder for users on Docker Desktop, and Docker Engine as of version 23.0. Is there any update on this feature request? |
Docker introduced BuildKit in 2017, and made it default on Linux in 2023. BuildKit requires completely new API during client-server communication. docker-py Python bindings is communicating with server directly, and has not been made aware of this new API - see docker/docker-py#2230 . To fix DISCOVERY-435, we wanted to use build-time secrets. This feature requires BuildKit, and therefore is not available in pytest unit tests that use docker-py library. To workaround this problem, we use DOCKER_HOST variable pointing to podman socket file. Podman is compatible with old Docker API, but still supports some of newer build features provided by BuildKit. This way we can use build-time secrets while still using old API. Podman will be used only if podman is installed and socket file exists. Developers without podman should not need to change their system, although they will notice failures in `make test-integration`.
Docker introduced BuildKit in 2017, and made it default on Linux in 2023. BuildKit requires completely new API during client-server communication. docker-py Python bindings is communicating with server directly, and has not been made aware of this new API - see docker/docker-py#2230 . To fix DISCOVERY-435, we wanted to use build-time secrets. This feature requires BuildKit, and therefore is not available in pytest unit tests that use docker-py library. To workaround this problem, we use DOCKER_HOST variable pointing to podman socket file. Podman is compatible with old Docker API, but still supports some of newer build features provided by BuildKit. This way we can use build-time secrets while still using old API. Podman will be used only if podman is installed and socket file exists. Developers without podman should not need to change their system, although they will notice failures in `make test-integration`.
Docker introduced BuildKit in 2017, and made it default on Linux in 2023. BuildKit requires completely new API during client-server communication. docker-py Python bindings is communicating with server directly, and has not been made aware of this new API - see docker/docker-py#2230 . To fix DISCOVERY-435, we wanted to use build-time secrets. This feature requires BuildKit, and therefore is not available in pytest unit tests that use docker-py library. To workaround this problem, we use DOCKER_HOST variable pointing to podman socket file. Podman is compatible with old Docker API, but still supports some of newer build features provided by BuildKit. This way we can use build-time secrets while still using old API. Podman will be used only if podman is installed and socket file exists. Developers without podman should not need to change their system, although they will notice failures in `make test-integration`.
Docker introduced BuildKit in 2017, and made it default on Linux in 2023. BuildKit requires completely new API during client-server communication. docker-py Python bindings is communicating with server directly, and has not been made aware of this new API - see docker/docker-py#2230 . To fix DISCOVERY-435, we wanted to use build-time secrets. This feature requires BuildKit, and therefore is not available in pytest unit tests that use docker-py library. To workaround this problem, we use DOCKER_HOST variable pointing to podman socket file. Podman is compatible with old Docker API, but still supports some of newer build features provided by BuildKit. This way we can use build-time secrets while still using old API. Podman will be used only if podman is installed and socket file exists. Developers without podman should not need to change their system, although they will notice failures in `make test-integration`.
Docker introduced BuildKit in 2017, and made it default on Linux in 2023. BuildKit requires completely new API during client-server communication. docker-py Python bindings is communicating with server directly, and has not been made aware of this new API - see docker/docker-py#2230 . To fix DISCOVERY-435, we wanted to use build-time secrets. This feature requires BuildKit, and therefore is not available in pytest unit tests that use docker-py library. To workaround this problem, we use DOCKER_HOST variable pointing to podman socket file. Podman is compatible with old Docker API, but still supports some of newer build features provided by BuildKit. This way we can use build-time secrets while still using old API. Podman will be used only if podman is installed and socket file exists. Developers without podman should not need to change their system, although they will notice failures in `make test-integration`.
Any idea if this is on the priority list? |
this lib/sdk uses docker engine API & currently there's no specific argument for it. other way to do it is by making buildkit as default builder. refer https://docs.docker.com/build/buildkit/#getting-started |
Is a pure-Python implementation strictly mandatory? Can we not depend on the Go implementation of this service while maintaining the spirit of Docker-Py? It seems low-level enough. What about using https://github.com/go-python/gopy for the binding layer? BuildKit is pretty mandatory these days and I'd rather not revert to subprocess calls. |
Bump: I'm really shocked to see this in 2024:
TL;DR: It is not possible to build a modern Dockerfile using docker-py. It's time to choose any option, not a convenient or nicely designed option, and fix this. |
Will this ever be fixed? The docker cli insists that I not use DOCKER_BUILDKIT=0 docker build . which outputs
So when |
Is there an upstream reference about this deprecation somewhere with a plan / dates when this is going to happen (the official docs just says it's deprecated but no further dates are given when it will break)? E.g. the docker-java API does also not support buildkit and a lot of projects use that one too .... That will break many users / consumers if non buildkit support will be removed. |
As I understand it, the "legacy builder" was deprecated in docker cli 23.0 and have not yet gotten a set release when it will be removed. Given that 23.0 was released in february 2023 and are still supported, I would expect the 26.x release to be supported for at least another year. Regardless, there is a sense of urgency to start the work adding buildkit support to this library if it wants to survive. |
Halting progress on this until docker/docker-py#2230 is closed.
Is the recommended immediate workaround to add docker build secrets still this? |
Halting progress on this until docker/docker-py#2230 is closed.
Notably, writing Apache Airflow dags, if we do not wish to use docker operator for GCP service account impersonation issues, we could use docker python sdk, but buildkit is really missing especially for secrets, for secured build |
Currently the Python SDK performs builds using the older build infrastructure. It would be good to support BuildKit so that users of the SDK can benefit from its various advantages.
The text was updated successfully, but these errors were encountered: