Olá Pessoal,
Fiquei com uma dúvida sobre o redirecionamento de portas no docker.
Para esse curso estou usando uma vm Ubuntu com as seguintes configurações de IP:
pcguest@vmdocker:~ $ ifconfig
docker0 Link encap:Ethernet HWaddr 02:42:6d:f5:6d:a2
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:6dff:fef5:6da2/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:7013 errors:0 dropped:0 overruns:0 frame:0
TX packets:18260 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:374301 (374.3 KB) TX bytes:26048490 (26.0 MB)
eth0 Link encap:Ethernet HWaddr 08:00:27:0e:30:cf
inet addr:192.200.8.181 Bcast:192.200.9.255 Mask:255.255.254.0
inet6 addr: fe80::a00:27ff:fe0e:30cf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:65003 errors:0 dropped:0 overruns:0 frame:0
TX packets:8660 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:30769667 (30.7 MB) TX bytes:719423 (719.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Executando o comando:
pcguest@vmdocker:~ $ docker run -it -p 8080:80 ubuntu/apache bash
Tenho o seguinte ip dentro do container:
eth0 Link encap:Ethernet HWaddr 02:42:ac:11:00:02
inet addr:172.17.0.2 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe11:2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:648 (648.0 B) TX bytes:648 (648.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Inicializando o Apache:
root@f63705a3e145:/# apachectl start
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
Neste caso qual o ip que devo usar no meu browser externo?