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

Skip configuring image in read-only systems #818

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alessfg
Copy link
Contributor

@alessfg alessfg commented Jul 20, 2023

The image in its current state fails when being run in read-only systems (nginxinc/docker-nginx-unprivileged#43). This PR aims to fix that.

@yosifkit
Copy link
Contributor

If the user is providing or relying on the scripts in /docker-entrypoint.d/ but not also providing the place they are expected to write as writeable, then the image shouldn't just ignore the scripts. Failure is the expected result so that they can fix their setup instead of getting a misconfigured service.

@alessfg
Copy link
Contributor Author

alessfg commented Jul 20, 2023

The intent (and the overall intent of the thread in the linked issue) of this PR is for the scripts to be ignored in read-only systems where the overall goal is for those scripts to be ignored altogether (aka systems that are set to read-only on purpose).

An alternative would be to provide an even more "minimal" version of the images that strips all the entrypoint scripts altogether, but I was trying to avoid adding yet another variant.

@yosifkit
Copy link
Contributor

In that case, wouldn't the simplest solution be to just skip the entrypoint altogether since it isn't providing anything except running the default command?

This one fails since it can't create var/cache/nginx/client_temp or /var/run/nginx.pid, which this PR can't really address:

$ docker run -d --read-only --entrypoint nginx nginx:[version] -g 'daemon off'

The only difference between these is a little extra output at the beginning, but both run nginx:

$ docker run -it --rm --read-only --tmpfs /var/cache/nginx/ --tmpfs /var/run/ --entrypoint nginx nginx -g 'daemon off;'
$ docker run -it --rm --read-only --tmpfs /var/cache/nginx/ --tmpfs /var/run/ nginx

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

Successfully merging this pull request may close these issues.

2 participants