#!/usr/bin/env bash image_version=`date +%Y%m%d%H%M`; docker stop health_monitor || true; docker rm health_monitor || true; # 删除镜像 docker rmi -f $(docker images | grep telpo/health_monitor | awk '{print $3}') docker build -f ./HealthMonitor.WebApi/Dockerfile . -t telpo/health_monitor:$image_version; # 启动容器 docker run --network=host -d -v /home/data/health_monitor/log:/var/health_monitor/logs --restart=always --name health_monitor telpo/health_monitor:$image_version --environment=Development #删除产生的None镜像 docker rmi -f $(docker images | grep none | awk '{print $3}') # 查看镜像列表 docker images; # 查看日志 docker logs health_monitor;