Skip to content
/ bob Public
forked from vitorfhc/bob

Bob is an automated tool for building and pushing multiple Docker images in a monorepo

License

Notifications You must be signed in to change notification settings

michaelc0n/bob

 
 

Repository files navigation

Bob, the builder

Maintainability Test Coverage

Bob is an automated multiple Docker images builder. It works by defining a simple YAML file and running its commands.

Under development

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

Installing

Using Go

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

From source

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

Using bob

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.

Configuration File (bob.yaml)

root schema

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) []

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 []

Example

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 run bob command!

Contributing

For now we are just getting Pull Requests as contribution. There's not much defined yet.

License

See LICENSE for more details.

⬆ Back to the top

About

Bob is an automated tool for building and pushing multiple Docker images in a monorepo

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%