Skip to content

Logging in to two Docker registries? #59

@roderik

Description

@roderik

I'm trying to build a docker container, from a private container on dockerhub, and push it to the github registry.

For public dockerhub packages, this works splendidly

  docker-rabbitmq:
    runs-on: ubuntu-latest
    needs: lerna
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}
      - name: Build the container
        uses: docker/build-push-action@v1
        with:
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
          registry: docker.pkg.github.com
          repository: xxx/yyy/rabbitmq
          tag_with_ref: true
          dockerfile: ./packages/yyy/containers/rabbitmq/Dockerfile
          cache_froms: xxx/yyy/rabbitmq:latest
          path: ./packages/yyy/containers/rabbitmq/

But for a private container, this fails because we are not logged in to DockerHub.

I tried to add the following before the build-push-action, but that does not get picked up

      - uses: azure/docker-login@v1
        with:
          username: "xxx"
          password: "xxx"

Any ideas on how to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions