I recently had the odd situation where it seemed like I had outbound Internet connectivity issues under Ruby powered by Docker but not with Python powered by Docker.

Here's how I disproved this:

docker run -it ruby:2.7.1 ping
64 bytes from ( icmp_seq=1 ttl=37 time=15.2 ms
64 bytes from ( icmp_seq=2 ttl=37 time=15.5 ms


docker run -it python:3.7.2 ping
64 bytes from ( icmp_seq=1 ttl=37 time=21.9 ms
64 bytes from ( icmp_seq=2 ttl=37 time=31.3 ms

The docker run command starts up an image. The -it option opens an interactive terminal underneath it and giving it a command like 'ping' runs that in the terminal.

One of the things that this Docker trick makes exceptionally easy is testing different versions of languages. Here's an example for Ruby:

docker run -it ruby:2.7.1 /bin/bash
root@4460a9daddff:/# ruby --version
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
root@4460a9daddff:/# irb
irb(main):001:0> puts "Hello World"
Hello World
=> nil

And for Python:

docker run -it python:3.7.2 /bin/bash
root@3fe135f566bb:/# python --version
Python 3.7.2
root@3fe135f566bb:/# python
Python 3.7.2 (default, Mar 27 2019, 08:41:08) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello World")
Hello World

Credit for this goes to my friend and Docker Guru / Docker Captain, Nick Janetakis. Nick teaches Docker online and I highly recommend his stuff.