RTX icon indicating copy to clipboard operation
RTX copied to clipboard

cannot get Internet working inside Docker container on new instance arax2.ncats.io

Open saramsey opened this issue 6 months ago • 0 comments

The new instance is in us-east-1, and it is of type m5a.4xlarge:

stephenr@ip-10-13-5-17:~$ ec2metadata --instance-type
m5a.4xlarge

It is running Ubuntu 22.04, as shown here:

stephenr@ip-10-13-5-17:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy

When I create a Docker container like this:

stephenr@ip-10-13-5-17:~$ sudo docker run --network=host ubuntu:latest ping 142.251.211.238
PING 142.251.211.238 (142.251.211.238) 56(84) bytes of data.
64 bytes from 142.251.211.238: icmp_seq=1 ttl=52 time=69.5 ms
64 bytes from 142.251.211.238: icmp_seq=2 ttl=52 time=69.2 ms
64 bytes from 142.251.211.238: icmp_seq=3 ttl=52 time=69.2 ms

networking seems to work inside the container, but when I do it like this:

stephenr@ip-10-13-5-17:~$ sudo docker run ubuntu:latest ping 142.251.211.238

it does not. The problem is that when we use --network=host, I don't think we can map host port 8080 to container port 80.

saramsey avatar Aug 07 '24 03:08 saramsey