I have an nginx
Docker container which runs fine from the command line but which does not restart at boot. It is started with --restart=on-failure
which I understand should also start it at boot (it certainly works that way on my other Docker containers).
docker run --name nginx --restart=on-failure --detach --mount type=bind,source=/etc/ssl,target=/etc/ssl,readonly --mount type=bind,source=/etc/pki,target=/etc/pki,readonly --mount type=bind,source=/etc/letsencrypt,target=/etc/letsencrypt,readonly -p 443:443 -d nginx
Any ideas why this might be the case or how I find out what's upsetting it? docker logs nginx
gives me nothing, just the log up to the end of the shut-down of the machine. This is on Centos 8 and, in case it matters, the nginx
configuration file contains:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name myurl.net;
ssl_certificate /etc/letsencrypt/live/myurl.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/myurl.net/privkey.pem;
ssl_client_certificate /etc/ssl/certs/my_ca.crt;
ssl_crl /etc/ssl/CA/ca.crl;
ssl_verify_client on;
location / {
proxy_pass http://172.17.0.1:8080/;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
...where the location
line is on a local docker network that lets nginx
talk with another docker container that runs the HTTP server which ultimately does the serving (nginx
is just in the loop to perform client authentication via SSL). Could this network bit somehow be causing a problem?