Poetry application to Docker, automatically.
Project description
Poetry Dockerize Plugin
Key features:
- Automatically generate a docker image from your Poetry application.
- Highly configurable. You can configure the image by adding a section in the
pyproject.toml
configuration file.
Installation
In order to install the plugin you need to have installed a poetry version >=1.2.0
and type:
poetry self add poetry-dockerize-plugin
Quickstart
No configuration needed! Just type:
poetry dockerize
>Building image: poetry-sample-app:latest
>Successfully built image: poetry-sample-app:latest
docker run --rm -it poetry-sample-app:latest
>hello world!
Configuration
To customize some options, you can add a [tool.dockerize]
section in your pyproject.toml
file. For example to change the image name:
[tool.dockerize]
name = "myself/myproject-app"
Configuration API Reference
This examples shows a complete configuration of the docker image:
[tool.docker]
name = "alternative-image-name"
tags = ["latest-dev"]
entrypoint = ["python", "-m", "whatever"]
python = "3.8"
ports = [5000]
env = {"MY_APP_ENV" = "dev"}
labels = {"MY_APP_LABEL" = "dev"}
name
customizes the docker image name.tags
declares a list of tags for the image.entrypoint
customizes the entrypoint of the image. If not provided, the default entrypoint is retrieved from thepackages
configuration.python
python version to use. Default is3.11
ports
exposes portsenv
declares environment variables inside the docker image.labels
append labels to the docker image. Default labels are added following the opencontainers specification.
Command-Line options
All command line options provided by the poetry-dockerize-plugin
may be accessed by typing:
poetry dockerize --help
License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for poetry_dockerize_plugin-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d0b2a033d8c8e75973f90993cb51a8bab3bb24c205fad7ca20b27adcb0ba456 |
|
MD5 | 880d3bdf0343a3b773f147f49c0e1d1e |
|
BLAKE2b-256 | 6277c34de92590812993e50aec259f9a798327310202036ef98d6e610450f6a2 |
Close
Hashes for poetry_dockerize_plugin-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 096dd64167d456720d28146815b46643cfd41c1173a387b5ed291ad2cdd49807 |
|
MD5 | ab5c83ebfde6954b2fe4f98abf1459f2 |
|
BLAKE2b-256 | 40fa2d68d6e9283ad459cc9a4d6a95fe2334ce67065be65d6829b37500f2f8d6 |