Docker查看启动参数

查询docker容器运行参数可以使用docker inspect命令,输出结果是格式化的,没有runlike的输出结果直观。

一、安装pip
# wget https://bootstrap.pypa.io/get-pip.py
# python get-pip.py
二、安装runlike
# pip install runlike 
三、查看docker run参数
# runlike containerid
# runlike 30f7fb2b2c88
docker run --name=zabbix-server-mysql --hostname=loc_web_mysql \
           --user=1997 --env=DB_SERVER_HOST=10.10.6.160 \
           --env=MYSQL_DATABASE=zabbix2 --env=MYSQL_USER=zabbix2 \
           --env=MYSQL_PASSWORD=zabbix_pwd2 --env=MYSQL_ROOT_PASSWORD=root_pwd \
           --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
           --env=TINI_VERSION=v0.19.0 --env=TERM=xterm --env=MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs \
           --env=MIBS=+ALL \
           --env=ZBX_VERSION=5.4.0 --env=ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git \
           --volume=/etc/localtime:/etc/localtime --volume=/etc/timezone:/etc/timezone \
           --volume=/var/lib/zabbix/snmptraps --volume=/var/lib/zabbix/export \
           --network=host --workdir=/var/lib/zabbix -p 10051:10051 \
           --restart=no --label='org.opencontainers.image.licenses=GPL v2.0' \
           --label='org.opencontainers.image.vendor=Zabbix LLC' \
           --label='org.label-schema.schema-version=1.0' \
           --label='org.opencontainers.image.url=https://zabbix.com/' \
           --label='org.label-schema.license=GPLv2' --label='org.label-schema.build-date=20201204' \
           --label='org.opencontainers.image.description=Zabbix server with MySQL database support' \
           --label='org.label-schema.vendor=CentOS' --label='org.opencontainers.image.title=Zabbix server (MySQL)' \
           --label='org.opencontainers.image.authors=Alexey Pustovalov <alexey.pustovalov@zabbix.com>' \
           --label='org.opencontainers.image.source=https://git.zabbix.com/scm/zbx/zabbix.git' \
           --label='org.label-schema.name=CentOS Base Image' \
           --label='org.opencontainers.image.version=5.4.0' \
           --log-driver=journald --detach=true -t zabbix/zabbix-server-mysql:centos-5.4.0 /usr/sbin/zabbix_server \
           --foreground -c /etc/zabbix/zabbix_server.conf
四、其他命令
  • 使用指定用户进入容器
# docker exec -it --user root  containerid
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值