Have a look at the analysis in this blog post. Essentially, the startup script inside the docker container ensures that the data directory is owned by elasticsearch. In /usr/local/bin/docker-entrypoint.sh you'll find:
if [[ "$(id -u)" == "0" ]]; then
# If requested and running as root, mutate the ownership of bind-mounts
if [[ -n "$TAKE_FILE_OWNERSHIP" ]]; then
chown -R 1000:0 /usr/share/elasticsearch/{data,logs}
fi
fi
For your own mounted volumes, I'd use the uid and gid settings in the docker compose file rather than changing this script.
Thanks for your information! I did see that in the script. And actually, I know the reason what the default setting didn't include backup repo because usually you wouldn't put the backup files together with the data. Anyways, thanks a lot!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.