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.

v2: docker driver doesn't support auto-push

See original GitHub issue

I’m experimenting with the v2 branch and ran into an issue with the basic use case below. Notice it’s using the default builder (no setup-buildx-action step) with the docker driver.

jobs:
  build:
    - uses: actions/checkout@v2

    - uses: docker/login-action@v1
      with:
        registry: ${{ env.REGISTRY }}
        username: ${{ env.USER }}
        password: ${{ secrets.PASSWORD }}

    - uses: docker/build-push-action@v2-build-push
      with:
        context: .
        tags: ${{ env.REGISTRY }}/myapp:latest
        push: true

The output for the build step is:

Run docker/build-push-action@v2-build-push
📣 Buildx version: 0.4.2
🏃 Starting build...
/usr/bin/docker buildx build --tag myregistry.io/myapp:latest --iidfile /tmp/docker-build-push-Ghos6S/iidfile --file ./Dockerfile --push .
auto-push is currently not implemented for docker driver
##[error]The process '/usr/bin/docker' failed with exit code 1

I realize the error is coming from buildx upstream, but considering this action is called “build-push”, I think users would expect this functionality to be implemented by the action if the underlying tool doesn’t support it — or at least have a large warning in the README. My use case is more complex than this example, and part of the appeal of this action is that it seamlessly handles pushing a dynamic number of tags.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:17
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

11reactions
crazy-maxcommented, Oct 23, 2020

You have three possibilities atm (the first one being the more straightforward).

With docker-container driver (via setup-buildx)

jobs:
  build:
    - uses: actions/checkout@v2
    - uses: docker/setup-buildx-action@v1
    - uses: docker/login-action@v1
      with:
        registry: ${{ env.REGISTRY }}
        username: ${{ env.USER }}
        password: ${{ secrets.PASSWORD }}
    - uses: docker/build-push-action@v2
      with:
        context: .
        tags: ${{ env.REGISTRY }}/myapp:latest
        push: true

With docker driver (without setup-buildx)

jobs:
  build:
    - uses: actions/checkout@v2
    - uses: docker/login-action@v1
      with:
        registry: ${{ env.REGISTRY }}
        username: ${{ env.USER }}
        password: ${{ secrets.PASSWORD }}
    - uses: docker/build-push-action@v2
      with:
        context: .
        tags: ${{ env.REGISTRY }}/myapp:latest
        load: true
    - run: docker push ${{ env.REGISTRY }}/myapp:latest

With docker driver (with setup-buildx)

jobs:
  build:
    - uses: actions/checkout@v2
    - uses: docker/setup-buildx-action@v1
      with:
        driver: docker
    - uses: docker/login-action@v1
      with:
        registry: ${{ env.REGISTRY }}
        username: ${{ env.USER }}
        password: ${{ secrets.PASSWORD }}
    - uses: docker/build-push-action@v2
      with:
        context: .
        tags: ${{ env.REGISTRY }}/myapp:latest
        load: true
    - run: docker push ${{ env.REGISTRY }}/myapp:latest
6reactions
ngraefcommented, Sep 9, 2020

And it should fix this current issue.

@crazy-max It doesn’t look like this issue has been fixed yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build docker image locally in GitHub Actions ... - Stack Overflow
This changes the behavior to use the local docker engine for images. ... name: Build service uses: docker/build-push-action@v2 with: load: ...
Read more >
Error: multiple platforms feature is currently not supported for ...
My environment: Docker Desktop: Engine: 20.10.14, Compose: v2.5.1; Mac M1 OS 12.2.1. When running the following:.
Read more >
Docker storage drivers
Docker supports several storage drivers, using a pluggable architecture. The storage driver controls how images and containers are stored and managed on ...
Read more >
docker buildx build
docker driver currently only supports importing build cache from the registry. $ docker buildx build --cache-from=user/app ...
Read more >
Configure logging drivers - Docker Documentation
No logs are available for the container and docker logs does not return any output. local, Logs are stored in a custom format...
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