- Notifications
You must be signed in to change notification settings - Fork0
eitancj/python_in_docker
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation

Just experimenting with building Docker images.
Containerizing a Python3-Streamlit app, in this case.
Inspired bythis short guide which I recommend.
- Git
- Docker
A simple way to work with Docker images locally:
https://www.docker.com/products/docker-desktop/
- Tested on macOS X
- Python 3.11.4
- Streamlit
- Debian-based container
- Clone git repo & cd into it
git clone https://github.com/eitancj/python_in_dockercd python_in_docker- Build image
docker build -t python_in_docker:V1 .# May take a few minutes: Streamlit is relatively heavy- Verify image creation
docker images python_in_docker- Run app
docker run -d --rm -p 8501:8501 --name pydock python_in_docker:V1# Make sure no other running process is using that port on your machine- Test app
open http://localhost:8501 # will open in your default web browser# Or simply copy and paste the address into your web browser- Gracefully stop (and remove) container when you're done
docker container stop pydock- Remove the created image
docker rmi python_in_docker:V1- Clean up local copy (unless you want to keep it)
cd .. && rm -rf python_in_docker# BE PRUDENT WITH 'rm -rf'.# Make sure you're in the right directory and aiming at the right folder.- That's it
About
Playing around with docker images, python and streamlit
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.