Skip to content
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

v2: docker driver doesn't support auto-push #100

Closed
ngraef opened this issue Sep 3, 2020 · 17 comments
Closed

v2: docker driver doesn't support auto-push #100

ngraef opened this issue Sep 3, 2020 · 17 comments
Labels
kind/upstream Changes need to be made on upstream project

Comments

@ngraef
Copy link

ngraef commented Sep 3, 2020

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.

@crazy-max
Copy link
Member

crazy-max commented Sep 3, 2020

@ngraef

auto-push is currently not implemented for docker driver

The error message will be more explicit in a further release. See docker/buildx#360.

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.

I think it's better to separate the build part from the setup part. As would for example setup-go which only installs Golang. But thanks for your input, will consider that.

@crazy-max crazy-max added this to the v2 milestone Sep 3, 2020
@ngraef
Copy link
Author

ngraef commented Sep 3, 2020

I think it's better to separate the build part from the setup part.

I agree. I really like the decision to extract login and setup from v2. 👍

In this case, the environment is already set up to use the docker driver. I don't expect this action to change that setup. I do expect an action called docker/build-push-action to be able to push images built with docker.

Thanks for considering, and great work with v2 so far!

@crazy-max
Copy link
Member

Version 2 has been merged to the main branch and is therefore available via uses: docker/build-push-action@v2 (mutable tag).

As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases.

And it should fix this current issue. Don't hesitate if you have any questions.

@ngraef
Copy link
Author

ngraef commented Sep 9, 2020

And it should fix this current issue.

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

@crazy-max crazy-max added the kind/upstream Changes need to be made on upstream project label Sep 9, 2020
@crazy-max
Copy link
Member

@ngraef Now the README with its examples clearly shows the use of setup-buildx within this action.

@ngraef
Copy link
Author

ngraef commented Sep 10, 2020

The result is the same with the setup-buildx step.

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
        push: true

Again, I know this is an upstream limitation, but I believe it makes sense for docker/build-push-action to support this basic use case despite buildx's lack of support for it.

@crazy-max
Copy link
Member

@ngraef

I believe it makes sense for docker/build-push-action to support this basic use case despite buildx's lack of support for it.

Our goal is to avoid hacks around this action and be as closed as possible of the buildx build command. @tonistiigi can tell us more about it.

@tonistiigi
Copy link
Member

I'm ok with a hack in buildx that just runs docker push after build until docker driver doesn't support full buildkit features(pending on containerd storage) if anyone has cycles to implement it.

X-Wei added a commit to X-Wei/pelican-gh-actions-xwei that referenced this issue Oct 17, 2020
@wbobeirne
Copy link

Surprised to find this closed, I also ran into this and was somewhat confused. Unfortunately I have to use the docker driver since multiple images in my build rely on "base" images being built on that same machine. Would definitely like to see this supported.

@Locustv2
Copy link

@wbobeirne - same here. How are you using the docker driver?

@crazy-max crazy-max reopened this Oct 23, 2020
@crazy-max
Copy link
Member

crazy-max commented 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

@veerendra2
Copy link

wow, seems v1 is easy to use, I can login, build and push in single step.

I started trying to use v2 to get rid of warning, did I miss anything?

name: Publish Docker image
on:
  release:
    types: [published]
jobs:
  push_to_registry:
    name: Push Docker image to GitHub Packages
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
      - name: Push to GitHub Packages
        uses: docker/build-push-action@v1
        with:
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
          registry: docker.pkg.github.com
          repository: my-org/my-repo/my-image
          tag_with_ref: true

@tonistiigi
Copy link
Member

@veerendra2 https://github.com/docker/build-push-action#upgrade-from-v1 https://github.com/docker/build-push-action/blob/master/UPGRADE.md

@crazy-max crazy-max removed this from the v2 milestone Oct 27, 2020
DazWilkin added a commit to DazWilkin/akri-http that referenced this issue Oct 29, 2020
@tonistiigi
Copy link
Member

docker/buildx#442

BoboTiG pushed a commit to nuxeo/nuxeo-drive that referenced this issue Nov 18, 2020
BoboTiG pushed a commit to nuxeo/nuxeo-drive that referenced this issue Nov 18, 2020
BoboTiG pushed a commit to nuxeo/nuxeo-drive that referenced this issue Nov 18, 2020
BoboTiG pushed a commit to nuxeo/nuxeo-drive that referenced this issue Nov 18, 2020
BoboTiG pushed a commit to nuxeo/nuxeo-drive that referenced this issue Nov 18, 2020
BoboTiG pushed a commit to nuxeo/nuxeo-drive that referenced this issue Nov 18, 2020
rubencabrera added a commit to rubencabrera/dinaip-linux-shell that referenced this issue Nov 20, 2020
runchard added a commit to s-build/v2ray that referenced this issue Nov 21, 2020
* try extract data from builder in Dockerfile

* tempororily build by commit

* use . for container

* revert the image name

* separate builder from dockerfile

* fix id conflicts

* try with tag builder

* explicit show from dockerfile

* fix load

* double load true here

* use docker as dockerbuilderx driver

* fix image tag

* fix v2ray path from builder

* push built image

* manully push due to the driver not support auto-push

ref: docker/build-push-action#100

* fix comment

* add id for missing outputs

* fix name for compile and build
noelo added a commit to petbattle/tournamentservice that referenced this issue Nov 25, 2020
bharat-rajani added a commit to CoCreate-app/CoCreateWS that referenced this issue Nov 28, 2020
Error: buildx call failed with: auto-push is currently not implemented for docker driver
docker-build action is having open issue docker/build-push-action#100
jens-maus referenced this issue in angelnu/RaspberryMatic Jan 4, 2021
@crazy-max
Copy link
Member

Ubuntu virtual environments have been updated and now use Buildx 0.5.1 so it should be available through docker/buildx#442.

prince-chrismc added a commit to prince-chrismc/user-management that referenced this issue Jan 21, 2021
adammcmaster added a commit to ou-astrophysics/vespa that referenced this issue Jan 21, 2021
prince-chrismc added a commit to prince-chrismc/user-management that referenced this issue Jan 23, 2021
…ilize CI (#52)

* Update package.json

* Update package.json

* Update upload.yml

* Create Dockerfile

* Update upload.yml

docker/build-push-action#100 (comment)

* Update upload.yml

* temp work around

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update Dockerfile.alt

* Update Dockerfile.alt

* Update Dockerfile.alt

* Update upload.yml

* Update upload.yml

* Update upload.yml

* Update user_routes.cpp

* Update Edit.js

* Update Delete.js
denzuko added a commit to denzuko/io.rearc.quest that referenced this issue Mar 23, 2021
abitrolly added a commit to abitrolly/kaitai_struct_visualizer that referenced this issue Apr 11, 2021
generalmimon pushed a commit to kaitai-io/kaitai_struct_visualizer that referenced this issue Apr 11, 2021
cjab pushed a commit to cjab/kaitai_struct_visualizer that referenced this issue Jul 4, 2021
@ozbillwang
Copy link

ozbillwang commented Oct 4, 2021

In my case, I didn't use the github action, but saw the same issue.

I fxed with adding below command before docker buildx build command

docker buildx create --use

@zdraganov
Copy link

zdraganov commented Oct 2, 2022

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

Can we somehow rely on the caching if we use the docker driver or we have to drop it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/upstream Changes need to be made on upstream project
Projects
None yet
Development

No branches or pull requests

8 participants