|
@@ -1,26 +1,27 @@
|
|
-:title: Learn Basic Commands
|
|
|
|
|
|
+:title: First steps with Docker
|
|
:description: Common usage and commands
|
|
:description: Common usage and commands
|
|
:keywords: Examples, Usage, basic commands, docker, documentation, examples
|
|
:keywords: Examples, Usage, basic commands, docker, documentation, examples
|
|
|
|
|
|
|
|
|
|
-Learn Basic Commands
|
|
|
|
-====================
|
|
|
|
|
|
+First steps with Docker
|
|
|
|
+=======================
|
|
|
|
|
|
-Starting Docker
|
|
|
|
----------------
|
|
|
|
|
|
+Check your Docker install
|
|
|
|
+-------------------------
|
|
|
|
|
|
-If you have used one of the quick install paths, Docker may have been
|
|
|
|
-installed with upstart, Ubuntu's system for starting processes at boot
|
|
|
|
-time. You should be able to run ``sudo docker help`` and get output.
|
|
|
|
-
|
|
|
|
-If you get ``docker: command not found`` or something like
|
|
|
|
-``/var/lib/docker/repositories: permission denied`` you will need to
|
|
|
|
-specify the path to it and manually start it.
|
|
|
|
|
|
+This guide assumes you have a working installation of Docker. To check
|
|
|
|
+your Docker install, run the following command:
|
|
|
|
|
|
.. code-block:: bash
|
|
.. code-block:: bash
|
|
|
|
|
|
- # Run docker in daemon mode
|
|
|
|
- sudo <path to>/docker -d &
|
|
|
|
|
|
+ # Check that you have a working install
|
|
|
|
+ docker info
|
|
|
|
+
|
|
|
|
+If you get ``docker: command not found`` or something like
|
|
|
|
+``/var/lib/docker/repositories: permission denied`` you may have an incomplete
|
|
|
|
+docker installation or insufficient privileges to access Docker on your machine.
|
|
|
|
+
|
|
|
|
+Please refer to :ref:`installation_list` for installation instructions.
|
|
|
|
|
|
Download a pre-built image
|
|
Download a pre-built image
|
|
--------------------------
|
|
--------------------------
|
|
@@ -51,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
|