1

Windows コンテナーを使用して docker swarm を作成しようとしています。3 つの仮想マシンを作成し、hyper-v を使用します。各 OS は Windows サーバー 2016 です。マシンの IP は次のとおりです。

windocker211    192.168.1.211
windocker212    192.168.1.212
windocker219    192.168.1.219

docker swarm ノードは次のとおりです。

PS C:\ConsoleZ> docker node ls
ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS
4c0g0o0uognheugw4do1a1h7y     windocker212          Ready               Active
bbxot0c8zijq7xw4lm86svgwp *   windocker219          Ready               Active              Leader
wftwpiqpqpbqfdvgenn787psj     windocker211          Ready               Active

use コマンドを作成します。

docker service create --name=demo5 -p 5005:5005 --replicas 6 192.168.1.245/cqgis/wintestcore:0.6

Docker イメージは asp.net core app で、Dockerfile は次のとおりです。

FROM  192.168.1.245/win/aspnetcore-runtime:1.1.2
COPY . /app
WORKDIR /app

ENV ASPNETCORE_URLS http://*:5005

EXPOSE 5005/tcp

ENTRYPOINT ["dotnet", "dotnetcore.dll"]

次に、成功を生み出します。

PS C:\ConsoleZ> docker service ls
ID                  NAME                MODE                REPLICAS            IMAGE                                 PORTS
omhu7e0vo96s        demo5               replicated          6/6                 192.168.1.245/cqgis/wintestcore:0.6   *:5005->5005/tcp


PS C:\ConsoleZ> docker service ps demo5
ID                  NAME                IMAGE                                 NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS
8pihnak9a2ei        demo5.1             192.168.1.245/cqgis/wintestcore:0.6   windocker212          Running             Running 59 seconds ago
ut3f3b9giu4w        demo5.2             192.168.1.245/cqgis/wintestcore:0.6   windocker219          Running             Running 47 seconds ago
iy1xjevt67yl        demo5.3             192.168.1.245/cqgis/wintestcore:0.6   windocker211          Running             Running about a minute ago
q7f1gnbwslr3        demo5.4             192.168.1.245/cqgis/wintestcore:0.6   windocker212          Running             Running about a minute ago
8zewaktcu32h        demo5.5             192.168.1.245/cqgis/wintestcore:0.6   windocker219          Running             Running about a minute ago
xq820kqwf3v9        demo5.6             192.168.1.245/cqgis/wintestcore:0.6   windocker211          Running             Running 55 seconds ago

しかし、私の質問は、サイトごとにアクセスできないことです

http://192.168.1.219:5005/
http://192.168.1.219:5005/
http://192.168.1.219:5005/

コマンドを使うとき

docker run -it -p 5010:5005 192.168.1.245/cqgis/wintestcore:0.6

私はhttp://192.168.1.219:5010/正しい結果を得ることができます

私のドッカー情報は

PS C:\ConsoleZ> docker info
Containers: 4
 Running: 3
 Paused: 0
 Stopped: 1
Images: 5
Server Version: 17.06.0-ce-rc1
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: active
 NodeID: bbxot0c8zijq7xw4lm86svgwp
 Is Manager: true
 ClusterID: 32vsgwrbn6ihvpevly71gkgxk
 Managers: 1
 Nodes: 3
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Root Rotation In Progress: false
 Node Address: 192.168.1.219
 Manager Addresses:
  192.168.1.219:2377
Default Isolation: process
Kernel Version: 10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)
Operating System: Windows Server 2016 Datacenter
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 2.89GiB
Name: windock219
ID: 7AOY:OT6V:BTJV:NCHA:3OF5:5WR5:K2YR:CFG3:VXLD:QTMD:GA3D:ZFJ2
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 297
 System Time: 2017-06-04T19:58:20.7582294+08:00
 EventsListeners: 2
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 192.168.1.245
 127.0.0.0/8
Live Restore Enabled: false
4

3 に答える 3