however i am only allowed to run the containers in read-only mode which is breaking the application. Only redis seemed to like the read-only mode so i thought about mounting an external persistent disk on the instance /dockervol/ where the apps can be given RW access but i cant seem to get that work here is something i have tried for example with nginx
I am not quite sure if I got your problem. (Btw. next time try to use the format features to format your code. This will make it a lot easier to read )
Are you only allowed to run the containers in read only mode by the company? I don’t get why you wouldn’t be allowed to write data to the containers, since containers are stateless and not ment to persist data anyways.
Anyways. Your approach with nginx is correct and should work. The problem here is that you don’t have a config for nginx in your directory /etc/nginx, which is mounted to /dockervol/nginx. If you place a valid nginx config named nginx.conf in /dockervol/nginx and restart the container everything should work fine.
thanks for chipping and i am absolutely sorry about the code formatting. Yes, the issue here is that we are only allowed to run containers in read only mode in our company. i was just looking for ways to make all the containers work with the read-only flag. I must also say you are right about my nginx.conf file it wasn’t in the right directory. once i placed it /dockervol/nginx i got the error
open() “/var/run/nginx.pid” failed (30: Read-only file system)
@hifyty: actualy your requirement is not that uncommon for container in government environments.
Though, with this sort of constraint, you will be much happier with Kubernetes. A pod can have as many init containers as required to do the prepration work, before the final containers are started.
@derteufelqwe: most images on Docker Hub are designed for simple operations, which usualy introduces things that are unacceptable in professional operation environment.
@derteufelqwe@hifyty
I tried doing it the same way but im getting thie below error
ginx: [emerg] open() “/etc/nginx/mime.types” failed (2: No such file or directory) in /etc/nginx/nginx.conf:14
Are there any good options we can run this container in readonly mode, as that is a requirement for me also.