This page (revision-52) was last changed on 23-Apr-2022 17:05 by Harry Metske

This page was created on 23-Apr-2022 17:05 by unknown

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
52 23-Apr-2022 17:05 49 KB Harry Metske to previous
51 23-Apr-2022 17:05 48 KB HarryMetske to previous | to last
50 23-Apr-2022 17:05 48 KB HarryMetske to previous | to last
49 23-Apr-2022 17:05 48 KB Harry Metske to previous | to last
48 23-Apr-2022 17:05 48 KB Harry Metske to previous | to last
47 23-Apr-2022 17:05 48 KB Harry Metske to previous | to last
46 23-Apr-2022 17:05 39 KB Harry Metske to previous | to last
45 23-Apr-2022 17:05 39 KB Harry Metske to previous | to last
44 23-Apr-2022 17:05 39 KB Harry Metske to previous | to last
43 23-Apr-2022 17:05 38 KB Harry Metske to previous | to last
42 23-Apr-2022 17:05 38 KB Harry Metske to previous | to last DOCKER_OPTS="-s devicemapper"
41 23-Apr-2022 17:05 38 KB HarryMetske to previous | to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 497 added 138 lines
__VOLUME usage__
I added {{VOLUME /usr/local/tomcat/logs}} to the Dockerfile and build a new image.\\
When running an __INSPECT__ you can see where the volume is mapped :
%%slimbox
{{{
[root@vbox dockerfiles]# docker inspect c6abceb6a4a2
[{
"AppArmorProfile": "",
"Args": [
"-c",
"/usr/local/tomcat/bin/catalina.sh run"
],
"Config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": [
"/bin/sh",
"-c",
"/usr/local/tomcat/bin/catalina.sh run"
],
"CpuShares": 0,
"Cpuset": "",
"Domainname": "",
"Entrypoint": null,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"ExposedPorts": {
"8080/tcp": {}
},
"Hostname": "c6abceb6a4a2",
"Image": "81d236795c31",
"Memory": 268435456,
"MemorySwap": 0,
"NetworkDisabled": false,
"OnBuild": null,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "tomcat",
"Volumes": {
"/usr/local/tomcat/logs": {}
},
"WorkingDir": ""
},
"Created": "2015-02-25T18:35:54.49438532Z",
"Driver": "devicemapper",
"ExecDriver": "native-0.2",
"HostConfig": {
"Binds": null,
"CapAdd": null,
"CapDrop": null,
"ContainerIDFile": "",
"Devices": [],
"Dns": null,
"DnsSearch": null,
"ExtraHosts": null,
"Links": null,
"LxcConf": [],
"NetworkMode": "bridge",
"PortBindings": {
"8080/tcp": [
{
"HostIp": "",
"HostPort": "80"
}
]
},
"Privileged": false,
"PublishAllPorts": false,
"RestartPolicy": {
"MaximumRetryCount": 0,
"Name": ""
},
"SecurityOpt": null,
"VolumesFrom": null
},
"HostnamePath": "/var/lib/docker/containers/c6abceb6a4a2e8b65e8ba1abf9eb89a7b1dfb6514a8b168fbf8d3cda48eb4d35/hostname",
"HostsPath": "/var/lib/docker/containers/c6abceb6a4a2e8b65e8ba1abf9eb89a7b1dfb6514a8b168fbf8d3cda48eb4d35/hosts",
"Id": "c6abceb6a4a2e8b65e8ba1abf9eb89a7b1dfb6514a8b168fbf8d3cda48eb4d35",
"Image": "81d236795c31d782a2ea81f73af1b33736ef279430c0815f008525233e22c77d",
"MountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c936,c992",
"Name": "/naughty_ritchie",
"NetworkSettings": {
"Bridge": "docker0",
"Gateway": "172.17.42.1",
"IPAddress": "172.17.0.4",
"IPPrefixLen": 16,
"MacAddress": "02:42:ac:11:00:04",
"PortMapping": null,
"Ports": {
"8080/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "80"
}
]
}
},
"Path": "/bin/sh",
"ProcessLabel": "system_u:system_r:svirt_lxc_net_t:s0:c936,c992",
"ResolvConfPath": "/var/lib/docker/containers/c6abceb6a4a2e8b65e8ba1abf9eb89a7b1dfb6514a8b168fbf8d3cda48eb4d35/resolv.conf",
"State": {
"ExitCode": 0,
"FinishedAt": "0001-01-01T00:00:00Z",
"Paused": false,
"Pid": 2899,
"Restarting": false,
"Running": true,
"StartedAt": "2015-02-25T18:35:55.099027392Z"
},
"Volumes": {
"/usr/local/tomcat/logs": "/var/lib/docker/vfs/dir/e93bf55338e0c40ef4480af00db9924999e5fcb8fc86f5885b76b32eff4207c8"
},
"VolumesRW": {
"/usr/local/tomcat/logs": true
}
}
}}}
%%
After stopping the container and removing it (docker stop and docker rm), the logoutput is still there :
{{{
[root@vbox dir]# ls -l /var/lib/docker/vfs/dir/e93bf55338e0c40ef4480af00db9924999e5fcb8fc86f5885b76b32eff4207c8
total 20
-rw-r--r--. 1 centos centos 6173 25 feb 19:47 catalina.2015-02-25.log
-rw-r--r--. 1 centos centos 0 25 feb 19:35 host-manager.2015-02-25.log
-rw-r--r--. 1 centos centos 0 25 feb 19:35 localhost.2015-02-25.log
-rw-r--r--. 1 centos centos 10586 25 feb 19:39 localhost_access_log.2015-02-25.txt
-rw-r--r--. 1 centos centos 0 25 feb 19:35 manager.2015-02-25.log
[root@vbox dir]#
}}}