question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Examples don't work as expected

See original GitHub issue

Troubleshooting

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

20reactions
RobinDaughertycommented, Sep 13, 2021

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 the DOCKER_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 from azure/docker-login to docker/login-action, or change the order so that azure/docker-login comes before docker/setup-docker-buildx.

So if you’re using docker/setup-docker-buildx action with the default driver (docker-container) and your docker/build-push-action complains about the docker driver you might have a configuration file issue.

6reactions
simperscommented, Apr 21, 2021

@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:

   ...
   - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v1
      with:
        driver: docker-container
        driver-opts: |
          image=moby/buildkit:master
          network=host
   ...

And the settings, driver and driver-opts, are not documented in the example as necessary so it is a very misleading example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

didn't work as expected | English examples in context - Ludwig
High quality example sentences with “didn't work as expected” in context from reliable sources - Ludwig is the linguistic search engine that helps...
Read more >
xDS example doesn't work as expected · Issue #5131 - GitHub
I'm playing with gRPC-xDS and I get stuck with some features/examples. 1. grpc-go/examples/features/xds doesn't works.
Read more >
7 Reasons Why Employees Don't Work and What You Can Do ...
Are your employees happy and productive? Here are 7 reasons why employees won't work hard - and what you can do to avoid...
Read more >
8 Steps To Take When Your Job Is Not What You Expected
What to do when your new job isn't what you expected · 1. Stay professional. · 2. Give the position a chance. ·...
Read more >
POSIX C Threads. pthread_cond_t example. Doesn't work as ...
I wrote a wrote a program and it doesn't work as I expect it to. I have two threads ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found