docker run -dit --name openresty -p 80:80 -p 443:443 -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro -v /opt/openresty/ssl:/opt/ssl -v /opt/openresty/conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf -v /opt/openresty/html:/usr/local/openresty/nginx/html -v /opt/openresty/logs:/usr/local/openresty/nginx/logs -v /opt/openresty/example:/usr/example --hostname=openresty --privileged=true --restart=always -m 16G --oom-kill-disable=true openresty
--hostname设置主机名
--restart=always 异常停机后自动启动
--oom-kill-disable=true 内存不够用不自动终止容器