Merge "Update docker config docs for insecure registry"
This commit is contained in:
commit
dbd97822a0
@ -70,86 +70,26 @@ Configure Docker on all nodes
|
|||||||
|
|
||||||
After starting the registry, it is necessary to instruct Docker that
|
After starting the registry, it is necessary to instruct Docker that
|
||||||
it will be communicating with an insecure registry.
|
it will be communicating with an insecure registry.
|
||||||
For example, To enable insecure registry communication on CentOS,
|
For example, To enable insecure registry communication,
|
||||||
modify the ``/etc/sysconfig/docker`` file to contain the following where
|
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
|
``192.168.1.100`` is the IP address of the machine where the registry
|
||||||
is currently running:
|
is currently running:
|
||||||
|
|
||||||
.. path /etc/sysconfig/docker
|
.. path /etc/docker/daemon.json
|
||||||
.. code-block:: ini
|
.. code-block:: json
|
||||||
|
|
||||||
INSECURE_REGISTRY="--insecure-registry 192.168.1.100:5000"
|
{
|
||||||
|
"insecure-registries" : ["192.168.1.100:5000"]
|
||||||
|
}
|
||||||
|
|
||||||
.. end
|
.. 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:
|
Restart Docker by executing the following commands:
|
||||||
|
|
||||||
For CentOS or Ubuntu with systemd:
|
For CentOS or Ubuntu with systemd:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl restart docker
|
systemctl restart docker
|
||||||
|
|
||||||
.. end
|
.. end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user