https://github.com/weastur/poetry-docker
Poetry build tool packaged into docker image with an actual Python
https://github.com/weastur/poetry-docker
ci cicd docker docker-image drone drone-ci poetry poetry-python python python-packaging
Last synced: about 2 months ago
JSON representation
Poetry build tool packaged into docker image with an actual Python
- Host: GitHub
- URL: https://github.com/weastur/poetry-docker
- Owner: weastur
- License: mit
- Created: 2022-07-04T16:46:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-04T00:36:52.000Z (about 2 months ago)
- Last Synced: 2025-05-04T01:25:04.908Z (about 2 months ago)
- Topics: ci, cicd, docker, docker-image, drone, drone-ci, poetry, poetry-python, python, python-packaging
- Language: Python
- Homepage:
- Size: 354 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# poetry-docker

[](https://github.com/weastur/poetry-docker/actions/workflows/docker-build.yml)
[](https://hub.docker.com/r/weastur/poetry/)
**non-windows** [Official Python](https://hub.docker.com/_/python/)
docker images with the latest [Poetry](https://python-poetry.org)## Usage
Image tags are generated from the next template:
`{poetry-version}-python-{official-python-image-tag}`,
where `{poetry-version}` is a numeric version or `latest`.For example:
```Dockerfile
FROM weastur/poetry:1.5.1-python-3.11.4-bookworm
FROM weastur/poetry:1.5.1-python-3.11-alpine
FROM weastur/poetry:latest-python-3.11
```There is one special tag - `latest` - which is equivalent to
`latest-python-latest`, so it's just the latest Poetry version
based on `python:latest` image.### Usage with `docker run`
The image can be run with `docker run` command. Notice that the `COMMAND` inside
is still `python3`, like in an Official Image.## Internals
The image itself is built on top of an Official Python Image, with the
reference Poetry's
[installer](https://github.com/python-poetry/install.python-poetry.org),
which means that **there are no additional dependencies** in the
resulting image. For example:```bash
➜ docker run -ti weastur/poetry bash
root@87ef07a9832a:/# pip list
Package Version
---------- -------
pip 22.0.4
setuptools 58.1.0
wheel 0.37.1
```Also, pay attention that **there are no additional settings** of Poetry,
like `poetry config virtualenvs.in-project true`Every single step of the build process runs with GitHub Actions.
## Where is python:XYZ image?
This project builds images with the latest poetry for **every latest**
version of every **supported** python for every available architecture which has
pre-built [cryptography](https://pypi.org/project/cryptography) and [cffi](https://pypi.org/project/cffi/). For now, those are `x86_64` and `aarch64` architectures.Also, there are no builds for **too old** systems like Debian `buster` or `bullseye`
or too old Alpine.### Why not to re-build every available tag?
- There is no way to install the actual poetry version on an outdated python (like `3.5`, for example)
- There is no way to install the actual poetry version on an outdated system (like Debian buster).
Poetry depends on `cryptography` which depends from `rust`. And there are some restrictions on the
versions of toolchains suitable for building those deps. In other words, some systems have too old
packages, so before installing poetry on `buster`, for example, we need to install the latest rust
toolchain, which is overkill, I believe.
- There is no power to re-build everything at least once a week. Github Actions runners are too slow## Contributing
You need Docker installed.
You can start from `.github/workflows/docker-build.yml` to inspect the build process.
The main files are `Dockerfile` and `update.py`.## License
MIT, see [LICENSE](./LICENSE).