Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centos7.3 docker compose network cannot connect, After you restart docker, it's normal #34541

Open
ss75710541 opened this issue Aug 17, 2017 · 3 comments

Comments

@ss75710541
Copy link

ss75710541 commented Aug 17, 2017

Repetition steps:

  1. install docker-ce and docker-compose
  2. docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.03.2-ce
Storage Driver: overlay
 Backing Filesystem: xfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-514.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.702 GiB
Name: srymaster1
ID: BEY3:7WNJ:AFKS:Q2KL:NOQT:7ABR:2UIN:S4LJ:XMDM:RI2H:U6O7:QF22
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
  1. run test network service
# ls test_centos*
test_centos1:
docker-compose.yml  run.sh  test.sh

test_centos2:
docker-compose.yml  run.sh  test.sh
# cat test_centos1/docker-compose.yml
version: '2'
services:
  testa1:
    image: offlineregistry.dataman-inc.com:5000/library/alpine3.4-base:latest
    container_name: testa1
    restart: always
    command: "tail -f /dev/stdout"
    depends_on:
      - testb1
    logging:
      driver: journald

  testb1:
    image: offlineregistry.dataman-inc.com:5000/library/alpine3.4-base:latest
    container_name: testb1
    restart: always
    command: "tail -f /dev/stdout"
    logging:
      driver: journald
# cat test_centos2/docker-compose.yml
version: '2'
services:
  testa2:
    image: offlineregistry.dataman-inc.com:5000/library/alpine3.4-base:latest
    container_name: testa2
    restart: always
    command: "tail -f /dev/stdout"
    depends_on:
      - testb2
    logging:
      driver: journald

  testb2:
    image: offlineregistry.dataman-inc.com:5000/library/alpine3.4-base:latest
    container_name: testb2
    restart: always
    command: "tail -f /dev/stdout"
    logging:
      driver: journald

run test_centos1

cd test_centos1
docker-compose up -d
...

# It's normal to start this time
docker exec -it testa1 ping testb1
PING testb1 (172.18.0.2): 56 data bytes
64 bytes from 172.18.0.2: seq=0 ttl=64 time=0.225 ms
64 bytes from 172.18.0.2: seq=1 ttl=64 time=0.127 ms

vi /etc/systemd/journald.conf

Add the following configuration

Storage=auto
Compress=yes
MaxFileSec=1day
MaxRetentionSec=1week

restart journald

systemctl daemon-reload
service systemd-journald restart

run test_centos2

cd ../test_centos2
docker-compose up -d

# At this point, the docker network doesn't work

# docker exec -it testa2 ping testb2
ping: bad address 'testb2'

restart docker

service docker restart
...

# It's normal at this time
docker exec -it testa2 ping testb2
PING testb2 (172.19.0.3): 56 data bytes
64 bytes from 172.19.0.3: seq=0 ttl=64 time=0.150 ms
64 bytes from 172.19.0.3: seq=1 ttl=64 time=0.132 ms
@ss75710541
Copy link
Author

It was submitted to docker's compose

docker/compose#5106

@ss75710541
Copy link
Author

ping ip is normal

DNS of another container cannot be resolved

@mimousewu
Copy link

Seems this issue never resolved since old versions v1.8
#23855
#13381
moby/libnetwork#947
#20026
#34666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants