I have two servers: one physical and one vm provided by stormwall. No problems when running docker-compose.yml on a physical server everything working as expected, but when i run same docker-compose.yml at VM, the any container has no internet. VM itself has internet.
Followed instructions from My docker container has no internet and no luck.
ufw disabled iptables ip4 forwarding is ok Ubuntu 18.04.6 LTS
p.s. network_mode host is working btw, but we need isolated bridge network (because using internal docker service name resolve) and because it is worked everywhere before. Something wrong with VM maybe?
Example 1:
docker-compose.yml
version: '3.3'
networks:
test-onc:
driver: bridge
volumes:
nginx_data: {}
services:
test:
image: nginx:latest
container_name: test
hostname: test
ports:
- "80:80"
volumes:
- /etc/timezone:/etc/timezone:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/www:/var/www:ro
- nginx_data:/var/log/nginx:rw
restart: unless-stopped
networks:
- test-onc
labels:
org.label-schema.group: "test"
nginx/conf.d
server {
listen 80;
root /var/www;
location /google/ {
proxy_pass https://google.com/;
}
}
starting: docker-compose up -d is working on physical server, but not on vm. Error:
[error] 22#22: *1 upstream timed out (110: Connection timed out) while SSL handshaking to upstream, client: XXX.XXX.XXX.XXX, server: , request: "GET /google/favicon.ico HTTP/1.1", upstream: "https://172.217.14.78:443/favicon.ico", host: "XXXXXXX"
if enter in container then trying apt-get update, no connection, but dns resolving is ok
Example 2:
docker-compose.yml
version: '3.3'
networks:
test-onc:
driver: bridge
services:
test:
image: ubuntu:trusty
command: ping google.com
container_name: test
hostname: test
volumes:
- /etc/timezone:/etc/timezone:ro
restart: unless-stopped
networks:
- test-onc
labels:
org.label-schema.group: "test"
docker-compose up -d, and has internet on both servers (phy and vm), ping by ip - ok, ping by server name - ok, apt-get update - ok
very strange behaviour. i didn't understand anything...