拉取prometheus镜像
#拉取镜像
docker pull prom/prometheus
#创建目录
mkdir -p /opt/prometheus
#创建配置文件,具体内容下一标题。
vi /opt/prometheus/prometheus.yml
#启动
docker run -itd --name prometheus -p 9090:9090 -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml -v /etc/localtime:/etc/localtime:ro prom/prometheus
配置文件内容