Open jakubgs opened 12 months ago
Furthermore, the turning of /opt/tomcat
into a volume means that every time the containers are re-created the volumes are as well, which leaves a lot of large volumes on the host:
> docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 0 0 0B 0B
Containers 0 0 0B 0B
Local Volumes 55 0 19.83GB 19.83GB (100%)
Build Cache 0 0 0B 0B
About 360 MB per volume in case of Pro version, or 280 MB in Community version:
> d run --rm -it --entrypoint=/bin/sh openkm/openkm-ce:6.3.12
# du -hsc /opt/tomcat
280M /opt/tomcat
280M total
Currently the official Docker image applies the
VOLUME
directive to the/opt/tomcat
folder:But this is wrong if you look at the documentation for Docker:
Since
/opt/tomcat
folder contains software in form or JARs, WARs, and scripts, it is not supposed to be a volume, since volumes are intended for "data generated and used Docker containers". This meansVOLUME
directive was used incorrectly.Furthermore:
This in effect means that it is impossible to modify the
/opt/tomcat
folder - for example to change permissions - since it's a volume:Such a
Dockerfile
intended to allow the container as non-root user will have no effect, since the/opt/tomcat
folder is a volume.The correct usage of
VOLUME
directive would be for folders like/opt/tomcat/conf
or/opt/tomcat/data
, not/opt/tomcat
.