=======
Docker Container Builder
------------------------
`dobuild` builds your project's containers specified by a compose-like yaml file.
`dotempl` templates files (eg. Dockerfiles, docker-stack.yaml's) based on the environment.
Installing
----------
git clone <this repo>
pipsi install ./dostack
Features
--------
- Build multiple containers with one command
- Control order of builds with inter-container dependencies
- Templating Dockerfiles, e.g. so that one container can FROM another without having to edit Dockerfile each build
Getting Started
---------------
Create a `dobuild.yaml` file in your project root, with a structure like this:
containers:
pinger:
context: ./docker/pinger
dockerfile: ./docker/pinger/Dockerfile.t
hello:
context: .
dockerfile: ./docker/hello/Dockerfile.t
hello2:
context: ./docker/hello2
dockerfile: ./docker/hello2/Dockerfile.t
depends_on:
- hello
This example defines three containers to be built, *pinger*, *hello* and *hello2*. Here we have declared that *hello2* depends on *hello*, so *hello* will always be built before *hello2*.
Now to build your containers, run
dobuild
And watch it happen! `dobuild` runs `docker build` under the hood for you, so the output will be familiar.
If for example, you only want to a build specific container (and it's dependencies), you can use:
dobuild hello2
which will build *hello2* (and *hello* as it's a dependency), but not *pinger*.
Templates
---------
`dobuild` templates your Dockerfiles using [moustache](https://mustache.github.io/mustache.5.html) templates.
For example, the Dockerfile for *hello2* above:
FROM {{ containers.hello }}
RUN echo "Building {{ containers.hello2 }}"
ENTRYPOINT echo Hello, World, 2!
You can use `{{ containers.<name> }}` to refer to the uri of any container in the project in the current build. Other available tags:
- `{{ docker.registry }}` The docker registry added to container URIs, if defined.
- `{{ docker.prefix }}` The prefix added to container URIs, if defined.
Container URIs (Tags)
---------------------
After building your containers, `dobuild` will tag them with meaningful names composed of a registry, prefix and the container name.
For example, running:
dobuild hello \
--registry registry.example.com \
--prefix owner/helloworld
Will build and tag the image with URI `registry.example.com/owner/helloworld/hello`.
Pushing to a Registry
---------------------
If you add the `--push` flag, and all containers built successfully, `dobuild` will push the containers to the specified registry.
Environment Variables
---------------------
Options can also be specified in environment variables. Note that options on the command line override the environment.
DOBUILD_FILE=./dobuild.yaml # Path to dobuild.yaml
DOBUILD_REGISTRY=registry.example.com # Docker registry
DOBUILD_PREFIX=owner/helloworld # Container URI prefix
DOBUILD_PUSH=True # Push containers after building
Metadata
Release files for dostack 0.5.4
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 | |
|---|---|---|---|---|
| dostack-0.5.4.tar.gz | 5.7 kB | Without provenance | Details |
Release files / dostack-0.5.4.tar.gz
| Download URL | dostack-0.5.4.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a6f29c0e5981b744e77089b7deccd066fe52a5d3bded20cfbc3e1855dae4b0a
|
|
BLAKE2b-256 checksum How to use checksums |
394bcbd2e7c84584a3d6f755800d14e54c6aea6b8e2c2b8aa370e69df32c9ced
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for dostack 0.5.4
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.