Build a secure and minimal python app using the Minimus python image
latest-dev
because it requires the package installer pip
. The runtime stage uses the fully distroless image to achieve the most secure app.
Create Docker Compose file
docker-compose.yml
file:Create a Python project
app
. Add the following to it:main.py
file.
requirements.txt
file to list the Python packages that the project depends on. Python’s default package installer pip
uses it. For our simple example, save only:
Create the Dockerfile
Dockerfile
:reg.mini.dev/python:latest-dev
so it can utilize PIP. The runtime stage uses the fully distroless production image - reg.mini.dev/python:latest
.Review the project directory
Authenticate to the Minimus registry
Build the app
app
folder. Once built, you will see a confirmation:Run and test the app
Clean up