diff --git a/操作文档/11、Docker常用命令.md b/操作文档/11、Docker常用命令.md index f834eb5..aaf11f8 100644 --- a/操作文档/11、Docker常用命令.md +++ b/操作文档/11、Docker常用命令.md @@ -87,7 +87,37 @@ docker build -t ms-admin . 在Linux宿主机中,我们可以采用 /etc/hosts 的编辑方式创建 ms-excel 10.10.14.77 但这个配置信息不是直接在Docker容器中传递过去,需要加上启动时的参数: -##### 运行容器【使用宿主机的hosts文件】 + + +#### 修改宿主机的$hosts$文件 + +``` +[root@localhost ~]# cat /etc/hosts +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 + +# 以下是微服务的服务器配置 +172.17.0.1 ms-saas-mgr +172.17.0.1 ms-user +172.17.0.1 ms-finance +172.17.0.1 ms-wallet +172.17.0.1 ms-order +172.17.0.1 ms-admin +172.17.0.1 ms-excel +172.17.0.1 ms-station +172.17.0.1 ms-protocol-shenghong +172.17.0.1 ms-distribute +172.17.0.1 ms-monitor +172.17.0.1 ms-openapi +172.17.0.1 ms-task +172.17.0.1 ms-websocket-ocpp +172.17.0.1 ms-protocol +[root@localhost ~]# +``` + + + +#### 运行容器【使用宿主机的$hosts$文件】 ```shell docker run -d --name gw-saas-mgr -p 7003:7003 -v /etc/hosts:/etc/hosts gw-saas-mgr