4.登录阿里云容器镜像服务
创建本地仓库名称:tmp-gateway-service-ms

5.镜像push到阿里云Docker Registry
切换到rancher/server
登录到阿里云Docker Registry
登录Docker Registry -> 打tag -> push到Docker Registry
[root@rancher-qa alaxiaoyou-api-gateway]# docker login --username=name@alaxiaoyou.com registry.cn-hangzhou.aliyuncs.com
Password:
Login Succeeded
[root@rancher-qa alaxiaoyou-api-gateway]# docker tag c2f59d36052d registry.cn-hangzhou.aliyuncs.com/xmbaby-tmp/tmp-gateway-service-ms
[root@rancher-qa alaxiaoyou-api-gateway]#
[root@rancher-qa alaxiaoyou-api-gateway]# docker push registry.cn-hangzhou.aliyuncs.com/xmbaby-tmp/tmp-gateway-service-ms
The push refers to a repository [registry.cn-hangzhou.aliyuncs.com/xmbaby-tmp/tmp-gateway-service-ms]
29ffcfda7ded: Pushed
202759902df6: Pushed
96f6833b8de8: Mounted from xmbaby-tmp/tmp-config-service-ms
071d8bd76517: Mounted from xmbaby-tmp/tmp-config-service-ms
latest: digest: sha256:825a0ec026c1f7c6eea01c2e5236c42dba11209b17ccd2ffad2b314c99b58b2d size: 1161
6.镜像查看:

至此,gateway-service-ms镜像交付完成。
用rancher编排UI工具来���动gateway-service:
1.进入rancher应用栈添加服务。因为网关gateway服务需映射80端口至宿主机,因此,创建容器选择“总是在每台主机上运行一个此容器的实例”。映射80端口。添加关联的目标服务。
网关服务gateway-service启动会连接关联的目标服务config-service,config-service是通过git管理的config配置项目来获取配置信息给网关服务。关联Zookeeper集群注册服务。

2.自动重启选择“从不(仅启动一次)”:

3.对于网关服务,可使用docker本身来管理内存分配,可进行动态调整:

4.进入容器查看gateway-service服务启动。

自此,网关服务gateway-service添加完成。
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx