Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

lvthillo/python-flask-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 fromDockerHub.

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 visithttp://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-container172.17.0.2$ docker inspect -f '{{ .Config.Hostname }}' my-container6095273a4e9b

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp