# Stupid Docker Tricks - Validating Outbound Connectivity from an Image

DevFeed: [Stupid Docker Tricks - Validating Outbound Connectivity from an Image](<https://devfeed.tech/articles/stupid-docker-tricks-validating-outbound-connectivity-from-an-image-28159.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/docker/2020/07/25/stupid-docker-tricks-validating-outbound-connectivity-from-an-image.html>)

Author: Fuzzygroup

Published: 2020-07-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Docker](<https://devfeed.tech/topics/docker.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Python](<https://devfeed.tech/topics/python.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Internet](<https://devfeed.tech/topics/internet.md>)

Tags: [command](<https://devfeed.tech/tags/command.md>), [connectivity](<https://devfeed.tech/tags/connectivity.md>), [docker](<https://devfeed.tech/tags/docker.md>), [internet](<https://devfeed.tech/tags/internet.md>), [python](<https://devfeed.tech/tags/python.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [terminal](<https://devfeed.tech/tags/terminal.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

This tutorial shows how to use Docker containers and docker run to test outbound Internet connectivity with Ruby and Python images, and how to launch interactive language environments.

## Source excerpt

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 google.com 64 bytes from ord30s26-in-f238.1e100.net (216.58.192.238): icmp_seq=1 ttl=37 time=15.2 ms 64 bytes from ord30s26-in-f238.1e100.net (216.58.192.238): icmp_seq=2 ttl=37 time=15.5 ms and docker run -it python:3.7.2 ping google.com 64 bytes from ord30s26-in-f238.1e100.net (216.58.192.238): icmp_seq=1 ttl=37 time=21.9 ms 64 bytes from ord30s26-in-f238.1e100.net (216.58.192.238): 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 google.com' 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 irb(main):002:0> 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.