Skip to content
Snippets Groups Projects
Commit 7fc375e6 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Make docker registry network mode configurable"

parents 7f41b14b e187ad79
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,9 @@ docker_registry_enabled: False ...@@ -14,6 +14,9 @@ docker_registry_enabled: False
# pull through cache. # pull through cache.
docker_registry_env: {} docker_registry_env: {}
# The network mode of the docker registry container. Default is 'host'.
docker_registry_network_mode: host
# The port on which the docker registry server should listen. # The port on which the docker registry server should listen.
# NOTE: This is set to 4000 rather than the default of 5000 to avoid clashing # NOTE: This is set to 4000 rather than the default of 5000 to avoid clashing
# with keystone. # with keystone.
......
...@@ -43,13 +43,17 @@ docker_registry_services: ...@@ -43,13 +43,17 @@ docker_registry_services:
{{ {} | {{ {} |
combine(docker_registry_env_tls if docker_registry_enable_tls | bool else {}) | combine(docker_registry_env_tls if docker_registry_enable_tls | bool else {}) |
combine(docker_registry_env_basic_auth if docker_registry_enable_basic_auth | bool else {}) | combine(docker_registry_env_basic_auth if docker_registry_enable_basic_auth | bool else {}) |
combine(docker_registry_env_listen) | combine(docker_registry_env_listen if docker_registry_network_mode == 'host' else {}) |
combine(docker_registry_env) }} combine(docker_registry_env) }}
enabled: "{{ docker_registry_enabled }}" enabled: "{{ docker_registry_enabled }}"
image: "{{ docker_registry_image_full }}" image: "{{ docker_registry_image_full }}"
network_mode: host network_mode: "{{ docker_registry_network_mode }}"
ports: "{{ [docker_registry_port ~ ':5000'] if docker_registry_network_mode == 'bridge' else [] }}"
volumes: "{{ docker_registry_volumes | select | list }}" volumes: "{{ docker_registry_volumes | select | list }}"
# The network mode of the docker registry container.
docker_registry_network_mode: host
# The port on which the docker registry server should listen. # The port on which the docker registry server should listen.
docker_registry_port: 5000 docker_registry_port: 5000
......
...@@ -27,9 +27,16 @@ Configuring the registry ...@@ -27,9 +27,16 @@ Configuring the registry
Docker Hub by setting REGISTRY_PROXY_REMOTEURL to Docker Hub by setting REGISTRY_PROXY_REMOTEURL to
"https://registry-1.docker.io". Note that it is not possible to push to a "https://registry-1.docker.io". Note that it is not possible to push to a
registry configured as a pull through cache. Default is ``{}``. registry configured as a pull through cache. Default is ``{}``.
``docker_registry_network_mode``
The network mode used for the docker registry container. Default is
``host``. When set to ``bridge``, port mapping is configured to expose the
registry through port ``docker_registry_port``.
``docker_registry_port`` ``docker_registry_port``
The port on which the docker registry server should listen. Default is The port on which the docker registry server should listen. Default is
4000. 4000. When ``docker_registry_network_mode`` is set to ``host``, configures
the port used by the registry server inside the container. When
``docker_registry_network_mode`` is set to ``bridge``, configures the
overlay network port.
``docker_registry_datadir_volume`` ``docker_registry_datadir_volume``
Name or path to use as the volume for the docker registry. Default is Name or path to use as the volume for the docker registry. Default is
``docker_registry``. ``docker_registry``.
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
# pull through cache. Default is an empty dict. # pull through cache. Default is an empty dict.
#docker_registry_env: #docker_registry_env:
# The network mode of the docker registry container. Default is 'host'.
#docker_registry_network_mode:
# The port on which the docker registry server should listen. Default is 4000. # The port on which the docker registry server should listen. Default is 4000.
#docker_registry_port: #docker_registry_port:
......
---
features:
- |
Adds a new flag, ``docker_registry_network_mode``, which defaults to
``host``. This may be used to set the network mode of the Docker registry
container.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment