-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Cannot use the buildx
with the docker compose v2 (cache_to feature not supported)
#9832
Comments
Had the same problem. Using Docker 20.10.18 (which includes Compose 2.11.0 (which includes #9729)) fixed it for me. Released 2 days ago. I can't describe how happy I am right now. I was two days away from getting my week ruined. Thanks for the fix! |
@dee-kryvenko Awesome! Glad to hear that. I'm closing this issue @kaznovac, feel free to comment/reopen if it's still an issue. |
Hi, we're basically trying to tackle the same thing: steps:
- uses: actions/checkout@v3
- name: Build images
uses: docker/bake-action@master
with:
load: true
targets: backend
set: |
backend.cache-from=type=gha
backend.cache-to=type=gha
- name: Run tests
run: docker compose run backend gives us
Are we missing anything? 😊 PS: the error is also the same using
|
@witsch Take a look to the Compose specification, you should be able to do it by defining |
@glours defining the caching in the service like this
yields the same error: |
Ho, ok, sorry, you should setup buildx action before using bake to be able to use a driver which support this option
|
Buildx is setup. It just complains that the cache-export feature is not supportet. This is the relevant snippet of the workflow: steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker
- name: Build images
uses: docker/bake-action@master
with:
load: true
files: testing.yml
targets: backend
We are running docker 20.10.18 and compose 2.11.2, so I expected caching to work now with the builx |
right it should, anyway regarding the error message, the best place to ask directly in the action repository |
Ok, we'll try there… Thanks for your help! 😊 |
The error message makes it clear - you are using docker driver and it does not support cache. You should use create command to set up docker-container driver. Before 20.10.18 it was broken with docker-container driver too, now it is fixed. |
Thank you for the clarification @dee-kryvenko. I misinterpreted the discussion in this issue, thinking it would work now with the |
Description
I'm trying to use
<service>.build.cache_to
property indocker-compose.yml
file to cache/restore the buildx image cache layers in subsequent GHA job runs (the same behavior is observable in local docker for mac distribution).<service>.build.cache_from
property seems to work correctly.Steps to reproduce the issue:
cache_to
instruction (e.g.cache_to: [ type=local,dest=/tmp/.buildx-cache-new,mode=max ]
)docker compose build
Describe the results you received:
the following error is displayed
I've tried using the
docker buildx create --use --bootstrap
, and still cannot instructdocker compose
to use thebuildx
.docker buildx bake
works as expected on the samedocker-compose.yml
Describe the results you expected:
I expect
docker compose
to work with default build driver, or to have an argument to select the desired build driver.Additional information you deem important (e.g. issue happens only occasionally):
reproducible always
Output of
docker compose version
:Output of
docker info
:Additional environment details:
The text was updated successfully, but these errors were encountered: