1、安装pip
[root@localhost ~]# wget https://bootstrap.pypa.io/get-pip.py
[root@localhost ~]# python get-pip.py
2、安装runlike
[root@localhost ~]# pip install runlike
3、先运行一个容器
[root@localhost ~]# docker run -d \
--name nginx \
--restart=always \
--privileged=true \
-p 80:80 \
-v /opt/ftp/:/usr/share/nginx/html/ftp \
nginx:latest
3、查看运行中容器的docker run参数(-p可以使参数格式化)
[root@localhost ~]# runlike -p nginx
docker run \
--name=nginx \
--hostname=17b83c872538 \
--mac-address=02:42:ac:11:00:0b \
--env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
--env=NGINX_VERSION=1.21.5 \
--env=NJS_VERSION=0.7.1 \
--env='PKG_RELEASE=1~bullseye' \
--volume=/opt/ftp/:/usr/share/nginx/html/ftp \
--privileged \
-p 80:80 \
--restart=always \
--label='maintainer=NGINX Docker Maintainers <docker-maint@nginx.com>' \
--detach=true \
nginx:latest \
nginx -g 'daemon off;'
[root@localhost ~]#