Examples don't work as expected
See original GitHub issueTroubleshooting
Before sumbitting a bug report please read the Troubleshooting doc.
Behaviour
I am trying to use buildx with cache in place of the default docker build. I am attempting to follow the general directions in the README.md of this project.
First, I am trying to just convert to using buildx in place of build. For this, I’ve tried using --load
to get the images into docker. I am building images off of each other, meaning container-2 uses FROM container-1 in the Dockerfile. When using this approach, buildx doesn’t find container-1, even after building it and loading it into docker. Normal docker build works just fine.
Next, I am trying to use a local registry to cache things. I am attempting to follow the instructions found here: https://github.com/docker/build-push-action#local-registry
Steps to reproduce this issue
Please see repository linked below. I have reduced these issues to a very simple sample repository with parallel workflows demonstrating each attempt.
https://github.com/antmerlino/ghaction-docker-buildx
Expected behaviour
For buildx with --load
, the expected behavior is that it builds just like regular docker build.
For buildx with local registry, the expected behavior is that I can communicate with the local registry.
Actual behaviour
For buildx with --load
, the actual behavior is that buildx can’t find the first container, when building the second.
For buildx with local registry, the actual behavior is that I get a TCP error. (I think this has to do with the fact that buildx is running using the docker-container driver and something isn’t right getting back to where the docker daemon is running.) Not sure what I’m doing wrong here.
Configuration
Please see the repo linked below for a full working (or not working) example of the issues https://github.com/antmerlino/ghaction-docker-buildx
Logs
Github action on the above repo contains all logs. If something more specific is needed to help, please let me know.
Other remarks
I think if we can get this repository working with the various workflows, demonstrating what is outlined in the README.md this repository could serve as a good reference for other users who’d like to have a working reference.
Thanks for the help!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (7 by maintainers)
Top GitHub Comments
It looks like I found the edge case that was causing my jobs to fail. I had the steps in this order:
docker/setup-docker-buildx
azure/docker-login
docker/build-push-action
The
azure/docker-login
action was setting theDOCKER_CONFIG
environment variable for later steps so buildx setup was modifying the default configuration file (~/.docker
), then the later steps all used a different configuration file. Two solutions worked here: either change fromazure/docker-login
todocker/login-action
, or change the order so thatazure/docker-login
comes beforedocker/setup-docker-buildx
.So if you’re using
docker/setup-docker-buildx
action with the default driver (docker-container
) and yourdocker/build-push-action
complains about thedocker
driver you might have a configuration file issue.@crazy-max as somebody pointed out, the example is not working. I have basically copy-pasted your example for how to cache with GitHub local cache and it is giving me the same error as above. Why do you have this example, and reference it, when people say it is not working?
The real version that seems to work involves setting these values in the BuildX setup:
And the settings,
driver
anddriver-opts
, are not documented in the example as necessary so it is a very misleading example.