dnephin / dobi

A build automation tool for Docker applications
https://dnephin.github.io/dobi/
Apache License 2.0
309 stars 36 forks source link

The :push job authentication does not work with multiple repositories. #170

Closed Fuco1 closed 4 years ago

Fuco1 commented 4 years ago

It seems I can use the :tag action to tag an image with another repository's name, but when I run :push only the authentication from the "base image" is used. Example:

image=project:
  image: registry.gitlab.com/project/math
  pull-base-image-on-build: true
  cache-from:
    - registry.gitlab.com/project/math:latest
    - "registry.gitlab.com/project/math:{env.TAG}"
  context: .
  tags:
    - "{env.TAG}"
    - latest
    - "project.azurecr.io/math:{env.TAG}"

When I run env TAG=master dobi project:tag three images are tagged, the first two with the registry.gitlab.com/project/math as image name and the third as project.azurecr.io/math:master.

However on push action the authentication is only looked at against registry.gitlab.com/project/math and so the last push does not go through.

I think we should check the authorization for each individual tag so we can push to multiple repositories.