[bitnami/clickhouse] Unable to mount clickhouse data directory as volume in docker /bitnami/clickhouse/data
Closed this issue · 5 comments
Name and Version
bitnami/clickhouse:24.10.1
What architecture are you using?
amd64
What steps will reproduce the bug?
Unable to mount the CLICKHOUSE_DATA_DIR
or CLICKHOUSE_VOLUME_DIR
directory as volumes in the docker-compose file. Compose I am using:
What is the expected behavior?
Volume should be mounted and data should persist
What do you see instead?
When building the image docker shows these logs and exits.
Gives Permission denied ["/var/lib/clickhouse/preprocessed_configs"]
Complete logs attached
Bitnami containers are designed to operate as non-root by default. Consequently, any files or directories used by the application should be owned by the root group, as the random user (1001 by default) is a member of this root group. To ensure proper permissions, you'll need to adjust the ownership of your local directory accordingly.
For more comprehensive information about non-root containers and their significance for security, you can explore the following resources:
- Why non-root containers are important for security
- Use Non-Root Containers
- Work With Non-Root Containers for Bitnami Applications
- Running non-root containers on Openshift
These references provide valuable insights into the best practices and considerations when working with non-root containers in Bitnami applications.
That may absolutely be the root cause of the issue but doesnt work out of the box in docker compose. Sure I can work around it in a Dockerfile but the problem here is how do you get it to work in docker compose?
Hi,
If you are bind-mounting local volumes, you need to give very open permissions so a non-root user can access them. You may need to provide the "others" group write permissions, for instance.
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.