PS C:\Users\Administrator> docker pull openresty/openresty
PS C:\Users\Administrator> docker run -d --name openresty -p 9000:80 openresty/openresty
PS C:\Users\Administrator> mkdir -p /docker/openresty
PS C:\Users\Administrator> docker cp openresty:/usr/local/openresty /docker/openresty/
PS C:\Users\Administrator> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ca953d88b019 openresty/openresty "/usr/bin/openresty …" 2 minutes ago Up 2 minutes 0.0.0.0:9000->80/tcp, :::9000->80/tcp openresty
PS C:\Users\Administrator> docker rm -f ca953d88b019
ca953d88b019
PS C:\Users\Administrator> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
删除命令
docker rm -f 容器ID
PS C:\Users\Administrator> docker run -d -p 9000:80 --name openresty --restart always --privileged=true -v C:\docker\openresty\openresty\nginx\conf\nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf -v C:\docker\openresty\openresty\nginx\logs\:/usr/local/openresty/nginx/logs openresty/openresty