From af932bfb2e12dd5bb8a0cb3d172ddd7f641600a9 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 15 Jan 2021 19:21:19 +0100 Subject: [PATCH] Fix workflow for auto-push impl Signed-off-by: CrazyMax --- .github/workflows/ci.yml | 20 +------- TROUBLESHOOTING.md | 106 --------------------------------------- 2 files changed, 1 insertion(+), 125 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 121d354..a325331 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,12 +244,6 @@ jobs: docker-driver: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - push: - - true - - false services: registry: image: registry:2 @@ -262,24 +256,12 @@ jobs: - name: Build id: docker_build - continue-on-error: ${{ matrix.push }} uses: ./ with: context: ./test file: ./test/Dockerfile - push: ${{ matrix.push }} + push: true tags: localhost:5000/name/app:latest - - - name: Check - run: | - echo "${{ toJson(steps.docker_build) }}" - if [ "${{ matrix.push }}" = "false" ]; then - exit 0 - fi - if [ "${{ steps.docker_build.outcome }}" != "failure" ] || [ "${{ steps.docker_build.conclusion }}" != "success" ]; then - echo "::error::Should have failed" - exit 1 - fi - name: Dump context if: always() diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 36a2a63..dd7cf6d 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -1,113 +1,7 @@ # Troubleshooting -* [`auto-push is currently not implemented for docker driver`](#auto-push-is-currently-not-implemented-for-docker-driver) * [Cannot push to a registry](#cannot-push-to-a-registry) -## `auto-push is currently not implemented for docker driver` - -If you're using the default builder (which uses the docker driver) without using our `setup-buildx-action`, you may -encounter this error message if you try to push your image: - -``` -Run docker/build-push-action@v2 -📣 Buildx version: 0.4.2 -🏃 Starting build... -/usr/bin/docker buildx build --tag localhost:5000/name/app:latest --iidfile /tmp/docker-build-push-eYl8PB/iidfile --file ./test/Dockerfile --push ./test -auto-push is currently not implemented for docker driver -Error: buildx call failed with: auto-push is currently not implemented for docker driver -``` - -While waiting for an implementation to be done on buildx/buildkit, you have the following possibilities -to solve this atm: - -### With `docker-container` driver and `setup-buildx` - -> Recommended solution - -```yaml -jobs: - build: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login - uses: docker/login-action@v1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.USER }} - password: ${{ secrets.PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - tags: ${{ env.REGISTRY }}/myapp:latest - push: true -``` - -### With `docker` driver - -```yaml -jobs: - build: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Login - uses: docker/login-action@v1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.USER }} - password: ${{ secrets.PASSWORD }} - - - name: Build - uses: docker/build-push-action@v2 - with: - context: . - tags: ${{ env.REGISTRY }}/myapp:latest - load: true - - - name: Push - run: docker push ${{ env.REGISTRY }}/myapp:latest -``` - -### With `docker` driver and `setup-buildx` - -```yaml -jobs: - build: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - driver: docker - - - name: Login - uses: docker/login-action@v1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.USER }} - password: ${{ secrets.PASSWORD }} - - - name: Build - uses: docker/build-push-action@v2 - with: - context: . - tags: ${{ env.REGISTRY }}/myapp:latest - load: true - - - name: Push - run: docker push ${{ env.REGISTRY }}/myapp:latest -``` - ## Cannot push to a registry While pushing to a registry, you may encounter these kinds of issues: