Update docker config docs for insecure registry

Change-Id: I751c3901b831aaed03b88d36184cd9cc5df1789b
Closes-Bug: #1779110
This commit is contained in:
Christian Zunker 2018-06-28 14:01:32 +02:00
parent 12d8ba0523
commit 8233bc7a84

View File

@ -70,86 +70,26 @@ Configure Docker on all nodes
After starting the registry, it is necessary to instruct Docker that
it will be communicating with an insecure registry.
For example, To enable insecure registry communication on CentOS,
modify the ``/etc/sysconfig/docker`` file to contain the following where
For example, To enable insecure registry communication,
modify the ``/etc/docker/daemon.json`` file to contain the following where
``192.168.1.100`` is the IP address of the machine where the registry
is currently running:
.. path /etc/sysconfig/docker
.. code-block:: ini
.. path /etc/docker/daemon.json
.. code-block:: json
INSECURE_REGISTRY="--insecure-registry 192.168.1.100:5000"
{
"insecure-registries" : ["192.168.1.100:5000"]
}
.. end
For Ubuntu, check whether its using upstart or systemd.
.. code-block:: console
# stat /proc/1/exe
File: '/proc/1/exe' -> '/lib/systemd/systemd'
Edit ``/etc/default/docker`` and add the following configuration:
.. path /etc/default/docker
.. code-block:: ini
DOCKER_OPTS="--insecure-registry 192.168.1.100:5000"
.. end
If Ubuntu is using systemd, additional settings needs to be configured.
Copy Docker's systemd unit file to ``/etc/systemd/system/`` directory:
.. code-block:: console
cp /lib/systemd/system/docker.service /etc/systemd/system/docker.service
.. end
Next, modify ``/etc/systemd/system/docker.service``, add ``environmentFile``
variable and add ``$DOCKER_OPTS`` to the end of ExecStart in ``[Service]``
section.
For CentOS:
.. path /etc/systemd/system/docker.service
.. code-block:: ini
[Service]
MountFlags=shared
EnvironmentFile=/etc/sysconfig/docker
ExecStart=
ExecStart=/usr/bin/docker daemon $INSECURE_REGISTRY
.. end
For Ubuntu:
.. path /etc/systemd/system/docker.service
.. code-block:: ini
[Service]
MountFlags=shared
EnvironmentFile=-/etc/default/docker
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS
.. end
.. note::
If your docker version is >=1.13.0, the ``docker daemon`` should be replaced
with ``dockerd``.
Restart Docker by executing the following commands:
For CentOS or Ubuntu with systemd:
.. code-block:: console
systemctl daemon-reload
systemctl restart docker
.. end