Graylog2 / graylog-docker

Official Graylog Docker image
https://hub.docker.com/r/graylog/graylog/
Apache License 2.0
357 stars 132 forks source link

Docker entrypoint is inefficient with disk space #260

Open junkiebev opened 9 months ago

junkiebev commented 9 months ago

https://github.com/Graylog2/graylog-docker/blob/5da05dfaae6f98929297acf1c19209a447d73ecf/docker-entrypoint.sh#L69C1-L73C109

these lines merge the plugins into one directory, which gets referenced

# Merge plugin dirs to allow mounting of /plugin as a volume
export GRAYLOG_PLUGIN_DIR=${GRAYLOG_HOME}/plugins-merged
rm -f ${GRAYLOG_PLUGIN_DIR}/*
find ${GRAYLOG_HOME}/plugins-default/ -type f -exec cp {} ${GRAYLOG_PLUGIN_DIR}/ \;
find ${GRAYLOG_HOME}/plugin ! -readable -prune -o -type f -a -readable -exec cp {} ${GRAYLOG_PLUGIN_DIR}/ \;

using cp instead of mv makes the image >200mb fatter at run-time for no upside I can determine. I wouldn't mind kicking in a PR, but before doing so I was curious if that was a conscious choice for backwards compatibility.

kroepke commented 9 months ago

Go go go :)