Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails when the volume is mounted readonly #74

Open
nedix opened this issue Mar 29, 2022 · 2 comments
Open

Fails when the volume is mounted readonly #74

nedix opened this issue Mar 29, 2022 · 2 comments

Comments

@nedix
Copy link

nedix commented Mar 29, 2022

I would like to mount my volume readonly but the container exits because it can't change ownership of the files.

Steps to reproduce:

$ docker run -v /home/user/www/:/var/www/html/:ro -p 8080:80 wodby/nginx:1.20

Result:

chown: /var/www/html: Read-only file system

@nedix
Copy link
Author

nedix commented Mar 29, 2022

docker-entrypoint.sh calls init_volumes which is created during build. I think it might not hurt if the error is simply redirected to stdout and execution continues, like so sudo init_volumes 2>&1. Better yet would be to not chown at all if the filesystem is readonly.

@AaronMcHale
Copy link

I would like to be able to use read_only: true in my docker-compose.yml as a security hardening measure, but run into a similar issue where the container refuses to start with the same message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants