yum install python3
pip3 install runlike
runlike -p 容器id或者容器名
[root@localhost ~]# runlike -p prometheus
docker run --name=prometheus --hostname=localhost.localdomain --user=root --env=TZ=Asia/shanghai --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --volume=/home/prometheus/conf/prometheus:/etc/prometheus:rw --volume=/home/prometheus/data/prometheus:/prometheus/data:rw --volume=/etc/prometheus --volume=/prometheus --volume=/prometheus/data --network=host --privileged --workdir=/prometheus --restart=always --label=‘com.docker.compose.oneoff=False‘ --label=‘com.docker.compose.version=1.29.1‘ --label=‘com.docker.compose.project.config_files=docker-compose.yml‘ --label=‘com.docker.compose.project=root‘ --label=‘com.docker.compose.project.working_dir=/root‘ --label=‘com.docker.compose.container-number=1‘ --label=‘com.docker.compose.service=prometheus‘ --label=‘maintainer=The Prometheus Authors <prometheus-developers@googlegroups.com>‘ --label=‘com.docker.compose.config-hash=b93dc6e36708e8a97804052604944752916d74b7a3169a78e43ea6149c21fbec‘ --runtime=runc --detach=true prom/prometheus --config.file=/etc/prometheus/prometheus.yml --web.enable-lifecycle
[root@localhost ~]#
# docker-compose文件
grafana:
image: grafana/grafana
container_name: grafana
network_mode: host
restart: always
privileged: true
user: root
depends_on:
- prometheus
environment:
- TZ=Asia/shanghai
volumes:
- /home/grafana/conf/grafana.ini:/etc/grafana/grafana.ini
- /home/grafana/data:/var/lib/grafana
runlike查看docker启动命令