1.pip install runlike
2.runlike -p 容器ID
root@ubuntu:~# runlike -p 498c3ad49c46
docker run \
--name=nginx \
--hostname=nginx \
--env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
--env='NGINX_VERSION=1.15.12-1~stretch' \
--env='NJS_VERSION=1.15.12.0.3.1-1~stretch' \
--volume=/data/php/dnmp/nginx/conf.d:/etc/nginx/conf.d:ro \
--volume=/data/php/www:/www:rw \
--volume=/data/php/dnmp/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \
--volume=/etc/nginx/conf.d \
--volume=/etc/nginx/nginx.conf \
--volume=/www \
--network=dnmp_lnmp \
-p 443:443 \
--expose=80 \
--label com.docker.compose.project="dnmp" \
--label com.docker.compose.version="1.18.0" \
--label com.docker.compose.oneoff="False" \
--label com.docker.compose.service="nginx" \
--label com.docker.compose.config-hash="4ad2cd21b7c3c4d0b69776274ea51f5de602a725aa
f3ec1c14c39511051aa904" \
--label maintainer="NGINX Docker Maintainers " \
--label com.docker.compose.container-number="1" \
--detach=true \
nginx:latest \
nginx -g 'daemon off;'