Skip to content

vaanforz/python-flask-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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/vaanforz/python-flask-docker.git
$ sudo docker build -t flask_image .

Run the container

Create a container from the image.

$ sudo docker run --name my-container -d -p 8080:8080 flask_image

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

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 41.9%
  • HTML 40.0%
  • Dockerfile 18.1%