An open API service indexing awesome lists of open source software.

https://github.com/gmemstr/whalepod

Mass Dockerfile generator written in Rust (experimental)
https://github.com/gmemstr/whalepod

Last synced: 5 months ago
JSON representation

Mass Dockerfile generator written in Rust (experimental)

Awesome Lists containing this project

README

          

Whalepod
===

**Quickly generate Dockerfiles**

Maintaining multiple Docker images for various version of an application - for example, Node.js -
can become tricky past a certain point. Whalepod aims to make it easier to generate and maintain
Dockerfiles using templates and YAML, and creating the neccesary tooling configuration to build
and push them.

[![asciicast](https://asciinema.org/a/328945.svg)](https://asciinema.org/a/328945)

Proof of concept using Whalepod: https://github.com/gmemstr/flutter-fastlane-android

whalepod.yml
---

The `whalepod.yml` file contains the information neccesary to generate the Docker images. It
requires a few things; first a name for the Docker image, followed by a list of versions, optional
parameters, and a template Dockerfile that will be processed.

### Example whalepod.yml

```yaml
name: whalepod-example
versions:
- 1.0
- 1.1
- 1.2
- 2.0
- 3.0
parameters:
hello_to: "Docker"
template: |
FROM alpine:3.7
LABEL version="<>"

RUN echo Hello <>!
```

Running
---

Running `whalepod` is as simple as executing the command with a valid `whalepod.yml` file. If your
`whalepod.yml` file is located elsewhere or is named something other than `whalepod.yml`, you can
specify another file with `whalepod `.

Each Dockerfile will live in it's own directory based on the version, and a Makefile will be
generated alongside it with pre-filled commands to build the images. An alternative output folder
can be specified by passing through the `--output ` (`-o=`) flag.

> TODO: add `docker push` command to Makefile

```
whalepod 0.1.0
Quickly generate Dockerfiles from YAML

USAGE:
whalepod [OPTIONS] [path]

FLAGS:
-h, --help Prints help information
-V, --version Prints version information

OPTIONS:
-o, --output [default: .]

ARGS:
The path to configuration file [default: whalepod.yml]
```

Disclaimer
---

This is very much an experiment, and my first foray into Rust. Feedback and contributions are
welcome - I intend to maintain it moving forward, and I do not intend to introduce breaking
changes, however keep that in mind!