Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Basic Python Flask app in Docker which prints the hostname and IP of the container

License

Notifications You must be signed in to change notification settings

magnolia-sre/python-flask-docker

 
 

Repository files navigation

python-flask-docker

Basic Python Flask app in Docker which prints the hostname and IP of the container

Build application

Build the Docker image manually by cloning the Git repo.

$ git clone https://github.com/lvthillo/python-flask-docker.git
$ docker build -t lvthillo/python-flask-docker .

Download precreated image

You can also just download the existing image from DockerHub.

docker pull lvthillo/python-flask-docker

Run the container

Create a container from the image.

$ docker run --name my-container -d -p 8080:8080 lvthillo/python-flask-docker

Now visit http://localhost:8080

 The hostname of the container is 6095273a4e9b and its IP is 172.17.0.2. 

Verify the running container

Verify by checking the container ip and hostname (ID):

$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' my-container
172.17.0.2
$ docker inspect -f '{{ .Config.Hostname }}' my-container
6095273a4e9b

About

Basic Python Flask app in Docker which prints the hostname and IP of the container

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Makefile 58.1%
  • Smarty 14.0%
  • Python 12.5%
  • HTML 10.6%
  • Dockerfile 4.8%