###
 # @Author: JinxuChen
 # @Date: 2021-11-15
 # @LastEditTime: 2021-12-02 15:19:22
 # @LastEditors: JinxuChen
 # @Description: In User Settings Edit
 # @FilePath: \GpsCardAdmin\setup_development.sh
###
#!/bin/bash
npm -v
npm config set registry https://registry.npm.taobao.org
npm config list
npm install
npm run build-test
image_version=`date +%Y%m%d%H%M`;
docker stop gps_card_admin_web || true;
# 删除gps_parent_web容器
docker rm gps_card_admin_web || true;
# 删除镜像
docker rmi -f $(docker images | grep telpo/gps_card_admin_web | awk '{print $3}')
# 构建telpo/gps_card_admin_web:$image_version镜像
docker build . -t telpo/gps_card_admin_web:$image_version;
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images;
# 启动容器
docker run -p 8803:80 -d --restart=always --name gps_card_admin_web telpo/gps_card_admin_web:$image_version;
# 查看日志
docker logs gps_card_admin_web;
