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

Not respecting login modifications #551

Closed
loagencydev opened this issue Jan 30, 2022 · 1 comment
Closed

Not respecting login modifications #551

loagencydev opened this issue Jan 30, 2022 · 1 comment

Comments

@loagencydev
Copy link

Troubleshooting

Before submitting a bug report please read the Troubleshooting doc.

Behaviour

Steps to reproduce this issue

  1. override docker config to accept an insecure repo (echo "{ \"insecure-registries\": [\"custom-repo.net\"] }" | sudo tee /etc/docker/daemon.json)
  2. use login-action to log into the private nexus repository with insecure configs
  3. try to push to the repository with build-push-action@v2
  4. get the error http: server gave HTTP response to HTTPS client

Expected behaviour

after adding the insecure configs to daemon.json, the push should also work with insecure repo

Actual behaviour

getting the error http: server gave HTTP response to HTTPS client

Configuration

  • Repository URL (if public):
  • Build URL (if public):
name: Push to Nexus

on:
  push:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Set insecure registry
        run: |
          echo "{ \"insecure-registries\": [\"custom-repo.net\"] }" | sudo tee /etc/docker/daemon.json
          sudo service docker restart
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Docker meta
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: |
            custom-repo.net/lo-agency/polaris
          tags: |
            type=schedule,pattern={{date 'YYYYMMDD'}}
            type=sha
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login to Nexus Container Registry
        uses: docker/login-action@v1 
        with:
          registry: custom-repo.net
          username: ${{ secrets.NX_USERNAME }}
          password: ${{ secrets.NX_PASSWORD }}
      -
        name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          platforms: linux/amd64
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

Logs

logs_16.zip

@crazy-max
Copy link
Member

@loagencydev You're using a docker-container builder with docker/setup-buildx-action@v1 so it doesn't use the dockerd configuration. You have to use the BuildKit daemon configuration like #353 (comment):

name: Push to Nexus

on:
  push:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Docker meta
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: |
            custom-repo.net/lo-agency/polaris
          tags: |
            type=schedule,pattern={{date 'YYYYMMDD'}}
            type=sha
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
        with:
          config-inline: |
            [registry."custom-repo.net"]
              http = true
              insecure = true
      -
        name: Login to Nexus Container Registry
        uses: docker/login-action@v1 
        with:
          registry: custom-repo.net
          username: ${{ secrets.NX_USERNAME }}
          password: ${{ secrets.NX_PASSWORD }}
      -
        name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          platforms: linux/amd64
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants