You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
658B

  1. #!/usr/bin/env bash
  2. image_version=`date +%Y%m%d%H%M`;
  3. docker stop health_monitor || true;
  4. docker rm health_monitor || true;
  5. # 删除镜像
  6. docker rmi -f $(docker images | grep telpo/health_monitor | awk '{print $3}')
  7. docker build -f ./HealthMonitor.WebApi/Dockerfile . -t telpo/health_monitor:$image_version;
  8. # 启动容器
  9. 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
  10. #删除产生的None镜像
  11. docker rmi -f $(docker images | grep none | awk '{print $3}')
  12. # 查看镜像列表
  13. docker images;
  14. # 查看日志
  15. docker logs health_monitor;