drone-plugins / drone-docker

Drone plugin for publishing Docker images
http://plugins.drone.io/drone-plugins/drone-docker
Apache License 2.0
319 stars 321 forks source link

Allow base image from a private repository #187

Open vincent-hatakeyama opened 6 years ago

vincent-hatakeyama commented 6 years ago

It’s possible to use a private registry with its credentials, but if the base image uses a private registry that is different from the one used for the new image, this plugin doesn’t provide a way to give the credentials.

I’d like to be able to either: – use the registry information on the project in drone, – or provide new variables to use in the .drone.yml.

tboerger commented 6 years ago

Have you tried to provide registry credentials to drone?

vincent-hatakeyama commented 6 years ago

Yes there is registry credentials (in settings/registry) and they do not appear to be used by the plugin. From what I understood of the code, there is only a single docker login done and its with the credentials given. It’s not possible to build an image where the base image and the result need different credentials.

bradrydzewski commented 6 years ago

the only think I can think of is that we optionally allow the user to provide a docker_config_json secret variable, which is essentially just the .docker/config.json file, which can store authentication credentials for multiple providers. Then we can write this to the /root/.docker/config.json

vincent-hatakeyama commented 6 years ago

It would be better to use the registry information in drone (…/settings/registry) as the information is already there, just not used. I’m not sure it is given to plugins.

natlibfi-arlehiko commented 6 years ago

Any plans for this?

poksiala commented 5 years ago

Pulling from private registry seems to be working with this https://discourse.drone.io/t/how-to-pull-private-images-with-1-0/3155

natlibfi-arlehiko commented 5 years ago

Yeah, it does now.

ywanbing commented 4 months ago

Has this problem been solved?

ywanbing commented 4 months ago

@vincent-hatakeyama I have also encountered this problem now, is there any good method?