Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Docker images for Python3 with poetry pre-installed.

Notifications You must be signed in to change notification settings

chazwatkins/python-poetry-docker

Repository files navigation

Poetry docker images

Poetry is a tool for dependency management and packaging in Python.

See the website for more information.

How to use this image

Create a Dockerfile in your Python app project

Using the poetry latest release

FROM chazw/poetry

WORKDIR /app
COPY . .

RUN poetry install --no-dev

CMD ["python", "./your-script.py"]

or for applications with a command-line interface:

FROM chazw/poetry

WORKDIR /app
COPY . .

RUN poetry install --no-dev --develop .

CMD ["app-cli-name", "your-command"]

Using the poetry preview release

Current preview has issues with toggling off the creation of virtual environments inside of a docker container. Reference pull request. Typically we would run poetry install ..., but must instead export to requirements.txt as a workaround.

FROM chazw/poetry:preview

WORKDIR /app
COPY . .

RUN poetry export -f requirements.txt --dev --without-hashes \
    && pip install --no-cache-dir -r requirements.txt -q

CMD ["python", "./your-script.py"]

or for applications with a command-line interface:

FROM chazw/poetry:preview

WORKDIR /app
COPY . .

RUN poetry export -f requirements.txt --dev --without-hashes \
    && pip install --no-cache-dir -r requirements.txt -q \
    && pip install -q --no-cache-dir .

CMD ["app-cli-name", "your-command"]

Image variants

The poetry images come in many variants for specific versions of python and the needed use case.

poetry:py<version>

Default image for the latest version of poetry and python.

poetry:py<version>-slim

Image for the latest version of poetry and python slim variant.

poetry:py<version>-preview

Image for the preview version of poetry and latest version python. Used for access latest features for poetry not yet in an official release.

poetry:py<version>-slim-preview

Image for the preview version of poetry and latest version python slim variant. Used for access latest features for poetry not yet in an official release.

About

Docker images for Python3 with poetry pre-installed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published