Bob is an automated multiple Docker images builder. It works by defining a simple YAML file and running its commands.
This project is under heavy development.
Tasks:
- Feature: build images
- Feature: push images
- Tests: pkg/helpers
- Improvement: use spf13/viper for better configuration
- Feature: dependencies between images
- Drop Docker support and go for CRI instead
- Tests: pkg/docker
- Feature: parallel building
- Feature: parallel pushing
Run go install
command as showed below:
$ export BOB_VERSION=latest # specify the version you want (example: v0.0.6)
$ go install github.com/vitorfhc/bob@$BOB_VERSION
To install the project from its source code you need to clone this repository and have golang
installed.
$ git clone https://github.com/vitorfhc/bob
$ cd bob
$ go build -o bob
$ sudo mv bob /usr/local/bin
Running bob
command gives you the following usage message:
Using this tool you may build and push several images in a monorepo.
All you need is a YAML file which has everything you need configured.
Examples:
bob build
Usage:
bob [command]
Available Commands:
build Builds Docker images
completion Generate the autocompletion script for the specified shell
help Help about any command
push Pushed Docker images
Flags:
-d, --debug wether to print debug messages
-h, --help help for bob
Use "bob [command] --help" for more information about a command.
field | type | description | default | required |
---|---|---|---|---|
.debug | boolean | if debug mode is on | false | |
.username | string | username to be used on push | "" | |
.password | string | password to be used on push | "" | |
.images | list | list of images (image schema) | [] |
field | type | description | default | required |
---|---|---|---|---|
.id | string | unique identifier for the image | random string | |
.name | string | name of the image | X | |
.tags | list of strings | image tags | [] (this defaults to a single tag latest ) |
|
.context | string | build context | current dir | |
.dockerfile | string | path to Dockerfile relative to context | Dockerfile | |
.target | string | Dockerfile target | ||
.buildArgs | map of strings | build args | ||
.registry | string | image registry to push to | "" | |
.needs | list of strings | strings referring to other images IDs that must be built before this one | [] |
In the examples folder you can find some ways to use bob
.
Take a look at this example's file:
images:
- name: from-bob
registry: vitorfhc
context: ./from-bob-image
needs:
- bob
- id: bob
name: bob
registry: vitorfhc
context: ./bob-image
The output for the first image will be an image tagged vitorfhc/from-bob:latest
. This image will be built only after vitorfhc/bob:latest
because it needs it. After building them with bob build
, you may push with bob push
. Simple, isn't it?
Warning: don't forget that the Dockerfile path (
.images[].dockerfile
) is relative to the context (.images[].context
)! Also, don't forget the context is relative to which directory you runbob
command!
For now we are just getting Pull Requests as contribution. There's not much defined yet.
See LICENSE for more details.