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

Succefull registry login, but I'm getting x509 error during build. #629

Closed
3 tasks done
Reivax47 opened this issue Oct 30, 2023 · 1 comment
Closed
3 tasks done

Comments

@Reivax47
Copy link

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

I can managed to login my private registry, but I can't build and push. At the top of my Dockerfile the line :
FROM myregistry/myimage:latest failed. I'm getting x509 error.

Expected behaviour

Once login is done, I should build the image using Dockerfile.

Actual behaviour

The build failed with x509 error.

Repository URL

No response

Workflow run URL

No response

YAML workflow

name: ci

on:
  push:
    branches: main

jobs:
  login:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
      - name: Construction du container
        uses: docker/setup-buildx-action@v3
      - name: Login to myRegistry
        uses: docker/login-action@v3
        with:
          registry: registry.athome.fr
          username: ${{ secrets.REGISTRYNAME }}
          password: ${{ secrets.REGISTRYPASS }}

      - name: Build and push
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./Dockerfile
          push: true
          tags: registry.athome.fr/monrepo:v1

Workflow logs

`

Dockerfile:1
--------------------
   1 | >>> FROM registry.athome.fr/mcusyspreweb:latest
   2 |     LABEL authors="xavier"
   3 |     CMD touch /coucou.txt
--------------------
ERROR: failed to solve: registry.athome.fr/mcusyspreweb:latest: failed to do request: Head "https://registry.athome.fr/v2/mcusyspreweb/manifests/latest": tls: failed to verify certificate: x509: certificate signed by unknown authority
Error: buildx failed with: ERROR: failed to solve: registry.athome.fr/mcusyspreweb:latest: failed to do request: Head "https://registry.athome.fr/v2/mcusyspreweb/manifests/latest": tls: failed to verify certificate: x509: certificate signed by unknown authority

BuildKit logs

No response

Additional info

I can manage to execute this command in the runner : docker login -u blabl -p blabla myrgistry.athome.fr.
I've added the registry.crt file in /etc/docker/certs.d/myregistry.athome.fr/registry.crt.
Thanks for your help.

@crazy-max
Copy link
Member

Similar to docker/setup-buildx-action#112 (comment), when using uses: docker/setup-buildx-action@v3 it will create container builder. Therefore you need to set up registry certificates for BuildKit.

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