docker-image-resource icon indicating copy to clipboard operation
docker-image-resource copied to clipboard

Provide credentials for base image different from the image to be built

Open chbiel opened this issue 5 years ago • 2 comments

Hi, i have the following setup:

Dockerfile of "child" image

FROM quay.io/team/base
...do something...

quay.io need authentication and the following would work as expected.

- name: docker-image-tools
    type: docker-image
    icon: docker
    source:
      repository: quay.io/team/base
      username: ((quay_username))
      password: ((quay_password))

Now I want to build the "child" image above, but push it to AWS ECR:

- name: docker-image-child
    type: docker-image
    icon: docker
    source:
      repository: account.dkr.ecr.region.amazonaws.com/child

When I execute that I get an error that authentication for quay.io is missing (what is basically OK).

But now the question: Can I provide different credentials for the base image and the image to created/push? Or do i have to ensure that the base image and the target image are in the same repo? I did not find anything related in the docs

Thanks in advance!

chbiel avatar Aug 22 '19 07:08 chbiel

I have the same issue and I am wondering why this issue does not affect many more people?

Would it somehow be possible to provide the content of the '.docker/config.json' file to the resource? This way one could craft such a config.json file that contains all needed credentials.

mischcon avatar Nov 06 '19 16:11 mischcon

This makes this resource completely unusable when pushing to a different repository now that dockerhub pretty much requires authentication due to rate limiting as you can't authenticate to dockerhub to build the image and push to any different repository

andrea3bianchi avatar Nov 06 '20 12:11 andrea3bianchi