systemctl status docker.service -l
vim /usr/lib/**/docker*(.)
ls -la /dev/docker/
total 0 drwxr-xr-x 2 root root 80 Feb 8 20:57 . drwxr-xr-x 13 root root 13880 Feb 8 20:57 .. lrwxrwxrwx 1 root root 7 Feb 8 20:56 data -> ../dm-0 lrwxrwxrwx 1 root root 7 Feb 8 20:57 metadata -> ../dm-1
nl /usr/lib/systemd/system/docker.service
1 [Unit]
2 Description=Docker Application Container Engine
3 Documentation=https://docs.docker.com
4 After=network.target docker.socket
5 Requires=docker.socket
6
7 [Service]
8 Type=notify
9 ExecStart=/usr/bin/docker daemon --storage-driver=devicemapper
10 --storage-opt dm.datadev=/dev/vg-docker/data
11 --storage-opt dm.metadatadev=/dev/vg-docker/metadata
12
13 MountFlags=slave
14 LimitNOFILE=1048576
15 LimitNPROC=1048576
16 LimitCORE=infinity
17
18 [Install]
19 WantedBy=multi-user.target
nl /usr/lib/systemd/system/docker.socket
1 [Unit] 2 Description=Docker Socket for the API 3 PartOf=docker.service 4 5 [Socket] 6 ListenStream=/var/run/docker.sock 7 SocketMode=0660 8 SocketUser=root 9 SocketGroup=docker 10 11 [Install] 12 WantedBy=sockets.target
[root@li198-71]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@li198-71]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@li198-71]#
[root@li198-71]# ls
bin Makefile poc_docker_compose README.md
[root@li198-71]# ls -la bin
total 24
drwxr-xr-x 2 root root 4096 Feb 8 21:47 .
dr-xr-x--- 11 root root 4096 Feb 8 21:50 ..
-rwxr-xr-x 1 root root 27 Feb 8 21:37 edit-docker-conf-files
-rwxr-xr-x 1 root root 363 Feb 8 21:47 locate-docker-data
-rwxr-xr-x 1 root root 83 Feb 8 21:38 locate-docker-without-data
-rw-r--r-- 1 root root 198 Jan 22 11:15 start-neo4j
[root@li198-71]# chmod 755 ./bin/start-neo4j
[root@li198-71]~# git commit
no changes added to commit (use "git add" and/or "git commit -a")
[root@li198-71]# git commit bin/start-neo4j -m 'neo4j docker launch script +x'
[master a8c24b3] neo4j docker launch script +x
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 bin/start-neo4j
[root@li198-71]# rehash
[root@li198-71]# start-neo4j
Unable to find image 'neo4j/neo4j:latest' locally
latest: Pulling from neo4j/neo4j
81cc5f26a6a0: Pull complete
a3ed95caeb02: Pull complete
5a4693d81fc5: Pull complete
4eb8ae21c936: Pull complete
45cca2aff21f: Pull complete
b4e009765568: Pull complete
5d7743cf349e: Pull complete
ea123b540978: Pull complete
38390692d3c3: Pull complete
86725222b184: Pull complete
1ea859a0b050: Pull complete
9010a2dbd3d0: Pull complete
Digest: sha256:f8b54a684e1cefaa5cc33454e7acb9bac6e8e578c43ee839cdcb2ed0c51d2644
Status: Downloaded newer image for neo4j/neo4j:latest
d92bc40ce86ebc49009e6907ca41c05692706edd40498f18fcbf67d5cd11577f
[root@li198-71]#
[root@li198-71]~# pvdisplay --- Physical volume --- PV Name /dev/xvdc VG Name docker PV Size 43.50 GiB / not usable 4.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 11136 Free PE 7296 Allocated PE 3840 PV UUID fHyoX3-fM23-9dXZ-rt2a-2XPB-CKni-Hs9otr
[root@li198-71]~# vgdisplay --- Volume group --- VG Name docker System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 43.50 GiB PE Size 4.00 MiB Total PE 11136 Alloc PE / Size 3840 / 15.00 GiB Free PE / Size 7296 / 28.50 GiB VG UUID ctP43M-A0Ak-RwqL-zMK7-6rHN-meMQ-pVAcI3
[root@li198-71]~# lvdisplay --- Logical volume --- LV Path /dev/docker/data LV Name data VG Name docker LV UUID dPDacY-GHzB-S2ha-yo7M-Ruc8-fdej-YtGzWi LV Write Access read/write LV Creation host, time li198-71.members.linode.com, 2016-02-08 20:56:40 +0000 LV Status available
LV Size 10.00 GiB Current LE 2560 Segments 1 Allocation inherit Read ahead sectors auto
- currently set to 8192 Block device 252:0
--- Logical volume --- LV Path /dev/docker/metadata LV Name metadata VG Name docker LV UUID itggzz-Ndyk-N5dm-Dzcw-U9pc-E08n-Pf3cBF LV Write Access read/write LV Creation host, time li198-71.members.linode.com, 2016-02-08 20:57:19 +0000 LV Status available
LV Size 5.00 GiB Current LE 1280 Segments 1 Allocation inherit Read ahead sectors auto
- currently set to 8192 Block device 252:1
[root@li198-71]~#
docker run -d --name redis -p 6379:6379 redis Unable to find image 'redis:latest' locally latest: Pulling from library/redis
03e1855d4f31: Pull complete a3ed95caeb02: Pull complete 2d5407e7b8c5: Pull complete 6fa6e206df11: Pull complete 1d849591577e: Pull complete d2eeea904d02: Pull complete 8782433053fa: Pull complete 58e12b50fee8: Pull complete a1a961e320bc: Pull complete Digest: sha256:de86bd14ab69c9b707fe5f3213f6e3c6f543df28bc05ae6cef7b61f2b12be343 Status: Downloaded newer image for redis:latest 5ac9264f14d7925adf8245a4a5aa28781bcadabab90d2f386672047b29de7d39
[root@li198-71]~/poc_docker_compose/1# docker volume ls DRIVER VOLUME NAME local f102e5827d97f932e5ebe34de997b068c6edad3b142e527cd656ca4b74f0c50a
[root@li198-71]/poc_docker_compose/1# docker volume ls
DRIVER VOLUME NAME
local f102e5827d97f932e5ebe34de997b068c6edad3b142e527cd656ca4b74f0c50a
[root@li198-71]/poc_docker_compose/1# docker volume inspect f102e5827d97f932e5ebe34de997b068c6edad3b142e527cd656ca4b74f0c50a
[
{
"Name": "f102e5827d97f932e5ebe34de997b068c6edad3b142e527cd656ca4b74f0c50a",
"Driver": "local",
"Mountpoint": "/var/lib/docker/volumes/f102e5827d97f932e5ebe34de997b068c6edad3b142e527cd656ca4b74f0c50a/_data"
}
]
[root@li198-71]/poc_docker_compose/1# find /var/lib/docker/volumes/f102e5827d97f932e5ebe34de997b068c6edad3b142e527cd656ca4b74f0c50a//poc_docker_compose/1#
[root@li198-71]~/poc_docker_compose/1# docker exec -ti redis bash
root@5ac9264f14d7:/data# ps awux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
redis 1 0.2 0.0 37208 3704 ? Ssl 22:02 0:00 redis-server *:6379
root 15 2.0 0.0 20224 3040 ? Ss 22:06 0:00 bash
root 22 0.0 0.0 17500 2088 ? R+ 22:06 0:00 ps awux
/var/lib/docker/volumes/f102e5827d97f932e5ebe34de997b068c6edad3b142e527cd656ca4b74f0c50a/
/var/lib/docker/volumes/f102e5827d97f932e5ebe34de997b068c6edad3b142e527cd656ca4b74f0c50a/_data
[root@li198-71]
root@5ac9264f14d7:/data# echo test > /etc/foo root@5ac9264f14d7:/data# exit exit [root@li198-71]~/poc_docker_compose/1# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5ac9264f14d7 redis "/entrypoint.sh redis" 3 minutes ago Up 3 minutes 0.0.0.0:6379->6379/tcp redis d92bc40ce86e neo4j/neo4j "/docker-entrypoint.s" 14 minutes ago Up 14 minutes 7473/tcp, 127.0.0.1:7474->7474/tcp goofy_rosalind
Interesting.. .
I didn't tell neo4j docker to store data in root's home directory '/root'
ls -la neo4j/data total 20 drwxr-xr-x 5 root root 4096 Feb 8 21:52 . drwxr-xr-x 3 root root 4096 Feb 8 21:52 .. drwxr-xr-x 2 root root 4096 Feb 8 21:52 dbms drwxr-xr-x 4 root root 4096 Feb 8 21:52 graph.db drwxr-xr-x 2 root root 4096 Feb 8 21:52 log