container cannot request other container when not set networks
Description
i start two containers by compose and expose port by ports, but it cannot request another container by host:port , when i set networks in my two containers,it success
Steps to reproduce the issue
1.compose file like this docker-compose1.yml: services: onlyoffice: container_name: onlyoffice #image: onlyoffice/documentserver:7.5.1.1 build: context: ./ privileged: true ports: - "8090:80" - "8443:443" ulimits: nofile: soft: "65536" hard: "65536" environment: JWT_ENABLED: false JWT_SECRET: JA6mdVboYvGibuI0h8u9 volumes: - ./log:/var/log/onlyoffice - ./data:/var/www/onlyoffice/Data restart: always
docker-compose2.yml: services: test: container_name: test image: nginx:alpine extra_hosts: - "www.example.com:10.115.0.227" environment: - LANG=C.UTF-8 - TZ=Asia/Shanghai restart: always 2. test 10.115.0.227:8090 from container 2 nerdctl exec -it test curl 10.115.0.227:8090 it failed 3.edited compose.yml and add networks in my files 4.it success return info from api
Describe the results you received and expected
when i use docker,it can success even if i do not set networks,but when i exchage to nerdctl,i faild to return when not set networks,is there any other way to solve it but set networks?
What version of nerdctl are you using?
2.3.5
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
No response
Source: containerd/nerdctl