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

Merge "Update docker config docs for insecure registry"

parents f1c6d54c 8233bc7a
No related branches found
No related tags found
No related merge requests found
......@@ -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
INSECURE_REGISTRY="--insecure-registry 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
.. path /etc/docker/daemon.json
.. code-block:: json
cp /lib/systemd/system/docker.service /etc/systemd/system/docker.service
{
"insecure-registries" : ["192.168.1.100:5000"]
}
.. 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
......
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