I am running 3 nodes on DigitalOcean (1 GB, with private networks), and after deploying this stack, containers cannot connect to other containers using host aliases.
This is my file docker-compose.yml:
version: "3"
services:
mongo:
image: mongo
ports:
- 27017:27017
networks:
mynet:
aliases:
- mongo
deploy:
placement:
constraints: [node.role == manager]
redis:
image: redis
ports:
- 6379:6379
networks:
mynet:
aliases:
- redis
deploy:
placement:
constraints: [node.role == worker]
app:
image: node
ports:
- 3030:3030
networks:
- mynet
depends_on:
- redis
- mongo
deploy:
mode: replicated
replicas: 2
placement:
constraints: [node.role == worker]
networks:
mynet:
Problem
root@mongo-container:/
root@mongo-container:/
root@redis-container:/
root@redis-container:/
root@app-container:/
root@app-container:/
Configuration
daemon.json
{ "userland-proxy": false }
docker version:
Client:
Version: 1.13.1
API version: 1.26
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 06:50:14 2017
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 06:50:14 2017
OS/Arch: linux/amd64
Experimental: true
Any idea how to fix this?
source
share