When using kolla-ansible project, I found that the function of docker login is called before pulling from the registry. We can configure the following items in global.yml used to login the registry:
...
docker_common_options:
auth_email: "{{ docker_registry_email }}"
auth_password: "{{ docker_registry_password }}"
auth_registry: "{{ docker_registry }}"
auth_username: "{{ docker_registry_username }}"
environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
restart_policy: "{{ docker_restart_policy }}"
restart_retries: "{{ docker_restart_policy_retry }}"
...
then docker login in kolla-ansible/ansible/library/kolla_docker.py
...
def pull_image(self):
if self.params.get('auth_username'):
self.dc.login(
username=self.params.get('auth_username'),
password=self.params.get('auth_password'),
registry=self.params.get('auth_registry'),
email=self.params.get('auth_email')
)
...
But when the build and push to the registry, I found that there is no such code and configuration. So I have to manually execute docker login command.
Because my company's registry is need username/password to login and to distinguish the read/write permissions. Use a read only access account when pull, and use an account with read and write access when push. I hope kolla can provide this function.
Fix proposed to branch: master /review. openstack. org/399426
Review: https:/