precompose
precompose is a tool to import a Compose application into an OSTree repository.
Distributing container images through an OSTree repository has some advantages, compared to the use of a container registry:
- Images are deduplicated at the file level with OSTree, instead of at the layer level.
- If your host is also managed by OSTree and is based on the same OS as your containers, then images are also deduplicated at the file level against the host.
- Updates are done at the file level, instead of at the layer level - this can save significant amounts of bandwidth when only one or a few files in a layer have changed.
precompose produces an OSTree commit which contains:
- Your original
docker-compose.yml, rewritten to pin each image to a specific SHA - A directory containing exploded copies of all the containers your application needs, which can be used as an additional image store with Podman
Requirements
In addition to the Python modules that it requires, precompose also needs some external tools to do its work:
Docker Compose
While docker-compose can be installed from PyPI, precompose only uses it as an external tool, since it does not have a stable API. Because it is not used as a library, and because you may have obtained docker-compose from a place other than PyPI, it is not declared as a Python dependency of this module. It is used to preprocess the Compose file and interpolate any environment variables that may be present in the image name.
docker-compose is also needed to run an application packaged with precompose.
OSTree
precompose shells out to the ostree command-line tool in order to create its commits.
Podman
precompose shells out to podman unshare to simulate being root and to podman pull --root to pull container images.
Your system must be configured in a way that podman can operate without root privileges (aka "rootless containers") - on most Debian and Ubuntu based systems, installing the uidmap package along with Podman should be enough. Your mileage may vary.
podman is also needed to run an application packaged with precompose, since Docker does not have anything equivalent to an additional image store. It is strongly recommended to use version 3.0 or later of Podman; the APIs used by docker-compose are incomplete in earlier versions.
Installation
Install using pip:
pip3 install precompose
...or, grab the latest release from GitHub or PyPI and install it manually.
Usage
precompose [-h] [--repo OSTREE] [--sign-by KEYID] [--arch ARCH] [--variant VARIANT] BRANCH COMPOSE
Import a Docker Compose application into ostree
positional arguments:
BRANCH ostree branch to commit to
COMPOSE path to docker-compose.yml
optional arguments:
-h, --help show this help message and exit
--repo OSTREE ostree repo to import to
--sign-by KEYID sign commit with GPG key
--arch ARCH architecture to import
--variant VARIANT variant to import
Utilities
precompose_utils (on GitHub and PyPI) contains a set of utilties for working with applications that have been packaged with precompose.
Metadata
Release files for precompose 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| precompose-0.4.0.tar.gz | 20.2 kB | Without provenance | Details for precompose-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| precompose-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for precompose-0.4.0-py3-none-any.whl |
Total release size: 38.8 kB
Release files / precompose-0.4.0.tar.gz
| Download URL | precompose-0.4.0.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
846ddab9aeb02c064c9c7c12cdb484a76d0b0c12f7defdef683bed27a55045fd
|
|
BLAKE2b-256 checksum How to use checksums |
f9af994a3b3f72df53833bacd37244638dc3bf2ebf1cb10bbcac186794b600af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / precompose-0.4.0-py3-none-any.whl
| Download URL | precompose-0.4.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a14e16add3894ab36b4643ba0e092dbdf329e87c4d43e4de82ba6339fbe3ef67
|
|
BLAKE2b-256 checksum How to use checksums |
06db1fff7735c679ef9848b0abad622e79048fba2579eded9d6d7ba9264f86f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Security for precompose 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.