使用powshell管理docker 创建与发布

介绍使用powshell管理docker 创建与发布

步骤:

1.执行脚本【dockercompose.ps1】,查看服务是否运行良好,如果良好,执行2步骤

2.执行构建发布脚本dockerpush.ps1

运行脚本dockercompose.ps1
1
2
3
4
5
6
#卸载先前环境
docker-compose down
#先构造
docker-compose build
#再运行
docker-compose up
构建发布脚本dockerpush.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
docker-compose down
docker-compose build
#docker-compose up
#列出所有windcatcher用户名的docker镜像
docker image ls windcatcher/*
# #删除所有windcatcher用户名的docker镜像
# docker rmi $(docker images windcatcher/* -q)
#tag镜像user_service并推送,用户名为windcatcher,tag为v1
docker tag user_service windcatcher/user_service:v1
docker push windcatcher/user_service:v1
# tag镜像product_service并推送,用户名为windcatcher,tag为v1
docker tag product_service windcatcher/product_service:v1
docker push windcatcher/product_service:v1
#tag镜像identity_service并推送,用户名为windcatcher,tag为v1
docker tag identity_service windcatcher/identity_service:v1
docker push windcatcher/identity_service:v1
#tag镜像ocelotgateway并推送,用户名为windcatcher,tag为v1
docker tag ocelotgateway windcatcher/ocelotgateway:v1
docker push windcatcher/ocelotgateway:v1
#tag镜像simpleclient并推送,用户名为windcatcher,tag为v1
docker tag simpleclient windcatcher/simpleclient:v1
docker push windcatcher/simpleclient:v1
您的支持将鼓励我继续创作