Skip to content

Instantly share code, notes, and snippets.

@jumasheff
Last active December 26, 2021 04:00
Show Gist options
  • Select an option

  • Save jumasheff/3c7156053ce8c5b69ff0bd54e0d5a5ed to your computer and use it in GitHub Desktop.

Select an option

Save jumasheff/3c7156053ce8c5b69ff0bd54e0d5a5ed to your computer and use it in GitHub Desktop.
Docker. Official. python 3.5.2-alpine and 3.5.2-slim

Install Docker:

wget -qO- https://get.docker.com/ | sh

Add your username to docker group to run docker commands without sudo:

sudo usermod -aG docker yourusername

Here, logout from your machine (warning: this will close all your active windows). After logging in you can check if Docker is installed by running a dummy container (this will download a container named 'hello-world'):

docker run hello-world

Install dockerized python containers. Just for comparison, I installed two versions. See official python images list here

docker pull python:3.5.2-alpine
docker pull python:3.5.2-slim

Example -- read hostname:

docker run python:3.5.2-alpine python -c "from socket import gethostname; print(gethostname())"

Example -- read installed modules:

docker run python:3.5.2-slim python -c "help('modules')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment