mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
docs: move a sysadmin-focused topic out of the basic usage manual and into installation docs (setting up a user group for non-root access)
docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
This commit is contained in:
parent
cf17816083
commit
cf5504eed5
3 changed files with 62 additions and 40 deletions
|
@ -57,6 +57,28 @@ Run the docker daemon
|
||||||
# start the docker in daemon mode from the directory you unpacked
|
# start the docker in daemon mode from the directory you unpacked
|
||||||
sudo ./docker -d &
|
sudo ./docker -d &
|
||||||
|
|
||||||
|
|
||||||
|
.. _dockergroup:
|
||||||
|
|
||||||
|
Giving non-root access
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
The ``docker`` daemon always runs as the root user, and since Docker version
|
||||||
|
0.5.2, the ``docker`` daemon binds to a Unix socket instead of a TCP port. By
|
||||||
|
default that Unix socket is owned by the user *root*, and so, by default, you
|
||||||
|
can access it with ``sudo``.
|
||||||
|
|
||||||
|
Starting in version 0.5.3, if you (or your Docker installer) create a
|
||||||
|
Unix group called *docker* and add users to it, then the ``docker``
|
||||||
|
daemon will make the ownership of the Unix socket read/writable by the
|
||||||
|
*docker* group when the daemon starts. The ``docker`` daemon must
|
||||||
|
always run as the root user, but if you run the ``docker`` client as a user in
|
||||||
|
the *docker* group then you don't need to add ``sudo`` to all the
|
||||||
|
client commands.
|
||||||
|
|
||||||
|
.. warning:: The *docker* group is root-equivalent.
|
||||||
|
|
||||||
|
|
||||||
Upgrades
|
Upgrades
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,43 @@ Type ``exit`` to exit
|
||||||
|
|
||||||
**Done!**, now continue with the :ref:`hello_world` example.
|
**Done!**, now continue with the :ref:`hello_world` example.
|
||||||
|
|
||||||
Upgrades
|
|
||||||
|
Giving non-root access
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
The ``docker`` daemon always runs as the root user, and since Docker version
|
||||||
|
0.5.2, the ``docker`` daemon binds to a Unix socket instead of a TCP port. By
|
||||||
|
default that Unix socket is owned by the user *root*, and so, by default, you
|
||||||
|
can access it with ``sudo``.
|
||||||
|
|
||||||
|
Starting in version 0.5.3, if you (or your Docker installer) create a
|
||||||
|
Unix group called *docker* and add users to it, then the ``docker``
|
||||||
|
daemon will make the ownership of the Unix socket read/writable by the
|
||||||
|
*docker* group when the daemon starts. The ``docker`` daemon must
|
||||||
|
always run as the root user, but if you run the ``docker`` client as a user in
|
||||||
|
the *docker* group then you don't need to add ``sudo`` to all the
|
||||||
|
client commands.
|
||||||
|
|
||||||
|
.. warning:: The *docker* group is root-equivalent.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
# Add the docker group if it doesn't already exist.
|
||||||
|
sudo groupadd docker
|
||||||
|
|
||||||
|
# Add the connected user "${USER}" to the docker group.
|
||||||
|
# Change the user name to match your preferred user.
|
||||||
|
# You may have to logout and log back in again for
|
||||||
|
# this to take effect.
|
||||||
|
sudo gpasswd -a ${USER} docker
|
||||||
|
|
||||||
|
# Restart the docker daemon.
|
||||||
|
sudo service docker restart
|
||||||
|
|
||||||
|
|
||||||
|
Upgrade
|
||||||
--------
|
--------
|
||||||
|
|
||||||
To install the latest version of docker, use the standard ``apt-get`` method:
|
To install the latest version of docker, use the standard ``apt-get`` method:
|
||||||
|
|
|
@ -18,10 +18,10 @@ your docker install, run the following command:
|
||||||
docker info
|
docker info
|
||||||
|
|
||||||
If you get ``docker: command not found`` or something like
|
If you get ``docker: command not found`` or something like
|
||||||
``/var/lib/docker/repositories: permission denied`` you have an incomplete
|
``/var/lib/docker/repositories: permission denied`` you may have an incomplete
|
||||||
docker installation. Please refer to :ref:`installation_list` for installation
|
docker installation or insufficient privileges to access docker on your machine.
|
||||||
instructions.
|
|
||||||
|
|
||||||
|
Please refer to :ref:`installation_list` for installation instructions.
|
||||||
|
|
||||||
Download a pre-built image
|
Download a pre-built image
|
||||||
--------------------------
|
--------------------------
|
||||||
|
@ -52,42 +52,6 @@ Running an interactive shell
|
||||||
# use the escape sequence Ctrl-p + Ctrl-q
|
# use the escape sequence Ctrl-p + Ctrl-q
|
||||||
sudo docker run -i -t ubuntu /bin/bash
|
sudo docker run -i -t ubuntu /bin/bash
|
||||||
|
|
||||||
.. _dockergroup:
|
|
||||||
|
|
||||||
The sudo command and the docker Group
|
|
||||||
-------------------------------------
|
|
||||||
|
|
||||||
The ``docker`` daemon always runs as the root user, and since Docker version
|
|
||||||
0.5.2, the ``docker`` daemon binds to a Unix socket instead of a TCP port. By
|
|
||||||
default that Unix socket is owned by the user *root*, and so, by default, you
|
|
||||||
can access it with ``sudo``.
|
|
||||||
|
|
||||||
Starting in version 0.5.3, if you (or your Docker installer) create a
|
|
||||||
Unix group called *docker* and add users to it, then the ``docker``
|
|
||||||
daemon will make the ownership of the Unix socket read/writable by the
|
|
||||||
*docker* group when the daemon starts. The ``docker`` daemon must
|
|
||||||
always run as the root user, but if you run the ``docker`` client as a user in
|
|
||||||
the *docker* group then you don't need to add ``sudo`` to all the
|
|
||||||
client commands.
|
|
||||||
|
|
||||||
.. warning:: The *docker* group is root-equivalent.
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# Add the docker group if it doesn't already exist.
|
|
||||||
sudo groupadd docker
|
|
||||||
|
|
||||||
# Add the connected user "${USER}" to the docker group.
|
|
||||||
# Change the user name to match your preferred user.
|
|
||||||
# You may have to logout and log back in again for
|
|
||||||
# this to take effect.
|
|
||||||
sudo gpasswd -a ${USER} docker
|
|
||||||
|
|
||||||
# Restart the docker daemon.
|
|
||||||
sudo service docker restart
|
|
||||||
|
|
||||||
.. _bind_docker:
|
.. _bind_docker:
|
||||||
|
|
||||||
Bind Docker to another host/port or a Unix socket
|
Bind Docker to another host/port or a Unix socket
|
||||||
|
|
Loading…
Add table
Reference in a new issue