aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorB. van Berkum <dev@dotmpe.com>2017-10-03 00:24:23 +0200
committerB. van Berkum <dev@dotmpe.com>2017-10-03 00:24:23 +0200
commit22a30602cb31f9b1e36aabae4259561625b7ffe3 (patch)
treea4b4a465bd651bf3c2e583ded3546495fa5e02c5 /doc
parent02ff7897c0bcb48521ddd0c494f346b6df275ab4 (diff)
downloadShaarli-22a30602cb31f9b1e36aabae4259561625b7ffe3.tar.gz
Shaarli-22a30602cb31f9b1e36aabae4259561625b7ffe3.tar.zst
Shaarli-22a30602cb31f9b1e36aabae4259561625b7ffe3.zip
Docker 101: container start and cleanup
Diffstat (limited to 'doc')
-rw-r--r--doc/md/docker/docker-101.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/md/docker/docker-101.md b/doc/md/docker/docker-101.md
index b02dd149..d12a1324 100644
--- a/doc/md/docker/docker-101.md
+++ b/doc/md/docker/docker-101.md
@@ -60,3 +60,40 @@ wheezy: Pulling from debian
60Digest: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe 60Digest: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe
61Status: Downloaded newer image for debian:wheezy 61Status: Downloaded newer image for debian:wheezy
62``` 62```
63
64Docker re-uses layers already downloaded. Iow. if you have only images based on some Alpine or Ubuntu version for example, those can share disk space.
65
66### Start a container
67A container is an instance created from an image, that can be run and that keeps running until its main process exits. Or until the user stops the container.
68
69The simplest way to start a container from image is ``docker run``. It also pulls the image for you if it is not locally available. For more advanced use, refer to ``docker create``.
70
71Note that stopped containers are not destroyed, unless you specify ``--rm``.
72To view all created, running and stopped containers, enter:
73
74```bash
75$ docker ps -a
76```
77
78Some containers may be designed or configured to be restarted, others are not. Note that both network ports and volumes of a container are created on start, and not editable later.
79
80### Access a running container
81A running container is accessible using ``docker exec``, or ``docker copy``.
82You can use ``exec`` to start a root shell in the Shaarli container:
83```bash
84$ docker exec -ti <container-name-or-id> bash
85```
86Note the names and ID's of containers are list in ``docker ps``. You an even type only one or two letters of the ID, given they are unique.
87
88Access can also be through one or more network ports, or disk volumes. Both are specified on and fixed on ``docker create`` or ``run``.
89
90### Docker disk use
91Trying out different images can fill some gigabytes of disk quickly. Besides images, the docker volumes usually take up most disk space.
92
93If you care only about trying out docker and not about what is running or saved,
94the following commands should help you out quickly:
95
96```bash
97$ docker rmi -f $(docker images -aq) # remove or mark all images for disposal
98$ docker volume rm $(docker volume ls -q) # remove all volumes
99```