Expected behavior
Try to deploy this image on a swarm. This application use SQL server to store data. I need to use an existing SQL server hosted on a server on the Docker host network (192.168.100.0). From the Docker host (192.168.100.10), I can connect to this SQL server(192.168.100.2) on the same way the container do it.
I want to deploy it on a swarm by running :
docker stack deploy -c .\docker-stack.yml test
Actual behavior
When I deploy it with compose, it works. But when I deploy it on the swarm, the created container cannot access to SQL server. I used the same compose file for both.
Information
Docker-stack.yml
version: '3.3'
services:
efficient5:
image: kronosefficient/efficient:5.3.1-ltsc2016
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
window: 120s
resources:
limits:
memory: 2000M
reservations:
memory: 200M
environment:
- EFFICIENT_URL=http://127.0.0.1
- SQLSERVER_NAME=192.168.100.2
- SQLSERVER_DBNAME=database
- SQLSERVER_USER=user
- SQLSERVER_PWD=pwd
volumes:
- document:c:\efficient5\App\Document
ports:
- "8080:80"
networks:
- ke5network
volumes:
document:
networks:
ke5network:
Docker info
PS c:\docker info
Containers: 6
Running: 0
Paused: 0
Stopped: 6
Images: 6
Server Version: 18.09.3
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog
Swarm: active
NodeID: -
Is Manager: true
ClusterID: -
Managers: 1
Nodes: 1
Default Address Pool: 10.0.0.0/8
SubnetSize: 24
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 192.168.100.10
Manager Addresses:
192.168.100.10:2377
Default Isolation: process
Kernel Version: 10.0 14393 (14393.2791.amd64fre.rs1_release.190205-1511)
Operating System: Windows Server 2016 Standard Version 1607 (OS Build 14393.2791)
OSType: windows
Architecture: x86_64
CPUs: 12
Total Memory: 16GiB
Name: DOCKER01
ID: -
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
I think it is related to the network. I saw docker_gwbridge is not present, maybe it isn’t exists on Windows.
I don’t know if I need to add a bridge network to connect the swarm overlay network to the hosts’ network.
Can you help me please ?