| ... | ... |
@@ -845,6 +845,13 @@ id may be optionally suffixed with ``:ro`` or ``:rw`` to mount the volumes in |
| 845 | 845 |
read-only or read-write mode, respectively. By default, the volumes are mounted |
| 846 | 846 |
in the same mode (rw or ro) as the reference container. |
| 847 | 847 |
|
| 848 |
+Known Issues (run -volumes-from) |
|
| 849 |
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 850 |
+ |
|
| 851 |
+* :issue:`2702`: "lxc-start: Permission denied - failed to mount" |
|
| 852 |
+ could indicate a permissions problem with AppArmor. Please see the |
|
| 853 |
+ issue for a workaround. |
|
| 854 |
+ |
|
| 848 | 855 |
.. _cli_search: |
| 849 | 856 |
|
| 850 | 857 |
``search`` |
| ... | ... |
@@ -30,44 +30,60 @@ Each container can have zero or more data volumes. |
| 30 | 30 |
Getting Started |
| 31 | 31 |
............... |
| 32 | 32 |
|
| 33 |
- |
|
| 34 |
- |
|
| 35 |
-Using data volumes is as simple as adding a new flag: ``-v``. The parameter ``-v`` can be used more than once in order to create more volumes within the new container. The example below shows the instruction to create a container with two new volumes:: |
|
| 33 |
+Using data volumes is as simple as adding a new flag: ``-v``. The |
|
| 34 |
+parameter ``-v`` can be used more than once in order to create more |
|
| 35 |
+volumes within the new container. The example below shows the |
|
| 36 |
+instruction to create a container with two new volumes:: |
|
| 36 | 37 |
|
| 37 | 38 |
docker run -v /var/volume1 -v /var/volume2 shykes/couchdb |
| 38 | 39 |
|
| 39 |
-For a Dockerfile, the VOLUME instruction will add one or more new volumes to any container created from the image:: |
|
| 40 |
+For a Dockerfile, the VOLUME instruction will add one or more new |
|
| 41 |
+volumes to any container created from the image:: |
|
| 40 | 42 |
|
| 41 | 43 |
VOLUME ["/var/volume1", "/var/volume2"] |
| 42 | 44 |
|
| 43 | 45 |
|
| 44 |
-Create a new container using existing volumes from an existing container: |
|
| 45 |
- |
|
| 46 |
+Mount Volumes from an Existing Container: |
|
| 47 |
+----------------------------------------- |
|
| 46 | 48 |
|
| 47 |
-The command below creates a new container which is running as daemon ``-d`` and with one volume ``/var/lib/couchdb``:: |
|
| 49 |
+The command below creates a new container which is runnning as daemon |
|
| 50 |
+``-d`` and with one volume ``/var/lib/couchdb``:: |
|
| 48 | 51 |
|
| 49 | 52 |
COUCH1=$(sudo docker run -d -v /var/lib/couchdb shykes/couchdb:2013-05-03) |
| 50 | 53 |
|
| 51 |
-From the container id of that previous container ``$COUCH1`` it's possible to create new container sharing the same volume using the parameter ``-volumes-from container_id``:: |
|
| 54 |
+From the container id of that previous container ``$COUCH1`` it's |
|
| 55 |
+possible to create new container sharing the same volume using the |
|
| 56 |
+parameter ``-volumes-from container_id``:: |
|
| 52 | 57 |
|
| 53 | 58 |
COUCH2=$(sudo docker run -d -volumes-from $COUCH1 shykes/couchdb:2013-05-03) |
| 54 | 59 |
|
| 55 | 60 |
Now, the second container has the all the information from the first volume. |
| 56 | 61 |
|
| 57 | 62 |
|
| 58 |
-Create a new container which mounts a host directory into it: |
|
| 63 |
+Mount a Host Directory as a Container Volume: |
|
| 64 |
+--------------------------------------------- |
|
| 65 |
+ |
|
| 66 |
+:: |
|
| 59 | 67 |
|
| 60 | 68 |
-v=[]: Create a bind mount with: [host-dir]:[container-dir]:[rw|ro]. |
| 61 | 69 |
If "host-dir" is missing, then docker creates a new volume. |
| 62 | 70 |
|
| 63 |
- This is not available for a Dockerfile due the portability and sharing purpose of it. The [host-dir] volumes is something 100% host dependent and will break on any other machine. |
|
| 71 |
+This is not available for a Dockerfile due the portability and sharing |
|
| 72 |
+purpose of it. The [host-dir] volumes is something 100% host dependent |
|
| 73 |
+and will break on any other machine. |
|
| 64 | 74 |
|
| 65 | 75 |
For example:: |
| 66 | 76 |
|
| 67 | 77 |
sudo docker run -v /var/logs:/var/host_logs:ro shykes/couchdb:2013-05-03 |
| 68 | 78 |
|
| 69 |
-The command above mounts the host directory ``/var/logs`` into the container with read only permissions as ``/var/host_logs``. |
|
| 79 |
+The command above mounts the host directory ``/var/logs`` into the |
|
| 80 |
+container with read only permissions as ``/var/host_logs``. |
|
| 70 | 81 |
|
| 71 | 82 |
.. versionadded:: v0.5.0 |
| 83 |
+ |
|
| 84 |
+Known Issues |
|
| 85 |
+............ |
|
| 86 |
+ |
|
| 87 |
+* :issue:`2702`: "lxc-start: Permission denied - failed to mount" |
|
| 88 |
+ could indicate a permissions problem with AppArmor. Please see the |
|
| 89 |
+ issue for a workaround. |