1.查看docker启动时的命令 rekcod可以将以下任何内容转换为docker run命令:
yum install npm -y && npm i -g rekcod?? ? docker ps -qa|rekcod 2.rekcod backendapp? ? ? ? ? ? ? #输入命令得到以下结果
[root@iZj6c7bzufsptcxdksnhdlZ ~]# rekcod backendapp
docker run --name backendapp --runtime runc -v /home/applications/backend/newbackendapp:/home/tomcat/webapps/ROOT -p 8888:8080/tcp --restart always -h 5a9ee8aaceae --expose 443/tcp --expose 8080/tcp -l org.label-schema.build-date='20181006' -l org.label-schema.license='GPLv2' -l org.label-schema.name='CentOS Base Image' -l org.label-schema.schema-version='1.0' -l org.label-schema.vendor='CentOS' -e 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/data/jdk7/bin' -e 'LC_ALL=zh_CN.utf8' -e 'JAVA_HOME=/data/jdk7' -e 'CLASSPATH=.:/data/jdk7/jre/lib/rt.jar:/data/jdk7/lib/tools.jar' -e 'TZ=Asia/Shanghai' -d bedc9e79a12b '/home/tomcat/bin/catalina.sh' 'run' ?
3.通过上面结果还原出原始命令为?
docker run -d --name=backendapp -v??/home/applications/backend/newbackendapp:/home/tomcat/webapps/ROOT -p 8888:8080?--restart=always?jinbian/c7-jdk7-t7:0.3
4.更新docker启动时参数
docker container update --restart=always nginx_ht
5.docker安装反查docker启动时命令参数
6.runlike 推荐使用上面第一种方式,那个一目了然些
# 常规语法 docker run --rm -v /var/run/docker.sock:/var/run/docker.sock assaflavie/runlike YOUR-CONTAINER # 使用别名运行它,例如,将其保存在~/.profile或中~/.bashrc alias runlike="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock assaflavie/runlike" runlike YOUR-CONTAINER #以本地命令运行
[root@iZj6c7bzufsptcxdksnhdlZ ~]# runlike backendapp docker run --name=backendapp --hostname=5a9ee8aaceae --mac-address=02:42:ac:11:00:02 --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/data/jdk7/bin? --env=LC_ALL=zh_CN.utf8 --env=JAVA_HOME=/data/jdk7 --env=CLASSPATH=.:/data/jdk7/jre/lib/rt.jar:/data/jdk7/lib/tools.jar --env=TZ=Asia/Shanghai? --volume=/home/applications/backend/newbackendapp:/home/tomcat/webapps/ROOT --expose=443 -p 8888:8080 --restart=always --label='org.label-schema.license=GPLv2'? --label='org.label-schema.name=CentOS Base Image' --label='org.label-schema.build-date=20181006' --label='org.label-schema.schema-version=1.0'? --label='org.label-schema.vendor=CentOS' --runtime=runc --detach=true bedc9e79a12b /home/tomcat/bin/catalina.sh run ?
?
|