Yaml based way to build Docker images.
Project description
.. image:: https://travis-ci.org/NLeSC/boatswain.svg?branch=master
:target: https://travis-ci.org/NLeSC/boatswain
.. image:: https://ci.appveyor.com/api/projects/status/5n7uj8ownch05e34/branch/master?svg=true
:target: https://ci.appveyor.com/project/NLeSC/boatswain/branch/master
.. image:: https://api.codacy.com/project/badge/Grade/67dac954463045d48541657bad72dcb2
:target: https://www.codacy.com/app/b-weel/boatswain?utm_source=github.com&utm_medium=referral&utm_content=nlesc-sherlock/boatswain&utm_campaign=Badge_Grade
.. image:: https://api.codacy.com/project/badge/Coverage/67dac954463045d48541657bad72dcb2
:target: https://www.codacy.com/app/b-weel/boatswain?utm_source=github.com&utm_medium=referral&utm_content=nlesc-sherlock/boatswain&utm_campaign=Badge_Coverage
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1149011.svg
:target: https://doi.org/10.5281/zenodo.1149011
Boatswain
=========
Boatswain is a simple build system for docker images.
It is especially usefull when you have multiple docker images that
depend on each other.
Installation
============
Boatswain is a simple python script you can install with pip
::
$ pip install boatswain
Usage
=====
Create a file called boatswain.yml for your project with the following
syntax, which is heavily based on docker-compose.
.. code-block:: yaml
version: 1.0 # The version of the boatswain yaml
organisation: boatswain # Your dockerhub organisation
images:
image1:pytest: # the key will be used to tag the image
context: docker/image1 # The path of the dockerfile
image2:pytest:
context: docker/image2
from: image1:pytest # This image depends on the other image
image3:pytest:
context: docker/image3
from: image2:pytest
image4:pytest:
context: docker/image4
tag: image12:pytest # This image will be tagged with this
Building
--------
You can build the images defined in the boatswain file using the following command. This invokes the docker build process for each image in the order so the dependencies are built before the dependent image.
::
$ boatswain build
Cleaning
--------
You can clean the images that are defined in the boatswain file.
::
$ boatswain clean
Pushing
-------
You can push the built images to dockerhub using the `push` command. It will be pushed to `organisation/imagetag` on dockerhub.
::
$ boatswain push
Extra Options
=============
-h
Display the options
-q, --quiet
Don't display any output
-k, --keep_building
Keep building images even if an error occurs
--dryrun
Do not actually execute the command, just go through the motions
-b <boatswain_file>, --boatswain_file <boatswain_file>
Override the default boatswain file (boatswain.yml)
-f, --force
Force building the images, even if they already exist
(only for build)
Debugging your build
====================
When your build does not go the way you expected boatswain
can display some more information by using:
-v
Verbose mode, displays a build progress for each image
-vv
Very verbose mode, displays the output of the docker build process
--debug
Debug mode, displays debug information of boatswain
as well as the output of the docker build process
==========
Change Log
==========
This document records all notable changes to Boatswain.
This project adheres to `Semantic Versioning <http://semver.org/>`_.
`1.0.2`_
* Added a non-zero exit code when a build fails
* Added a build summary show succesful and non-succesfully built images
* Added a keep-building (-k) command line argument
* Building now stops at the first failed image by default
`1.0.1`_
--------
* Fixed some packaging things
`1.0.0`_
-------
* Fixed help text of push command
* Fixed extraction of image id from docker response in some cases
* Windows compatibility
* Appveyor windows tests are passing
`0.7.0`_ (2017-04-03)
----------
* Added a 'before' and 'command' key to the build definition. This is a list of commands that need to be staged into the context directory.
* Default verbosity only shows 1 progress bar for all images
* Changed progress indication to full white block
`0.6.0`_ (2017-03-09)
--------------------
* Added the tree command which will print the tree of the boatswain file
* Added quiet and extra verbose modes
`0.5.1`_ (2017-02-10)
* Fixed issue with printing unicode text from the docker stream
`0.5.0`_ (2017-02-10)
---------------------
* Implemented push command
* Build will now greedily try to build images instead of throwing an exception at the first error.
* Added error messages to failing builds
* Standardized return values (e.g. always a list)
* Refactored to reduce code duplication in boatswain class
`0.4.0`_ (2017-02-09)
---------------------
* Progress timer now increases every second
* Improved error reporting (No longer uses an exception)
`0.3.0`_ (2017-02-08)
---------------------
* Added a whole bunch of tests
* Added the clean command
* Changed file layout from recursive to using from
`0.2.0`_ (2017-02-06)
---------------------
* Added dry-run option
* Added ability to build only one image
`0.1.0`_ (2017-02-02)
---------------------
* Initial release
.. _0.1.0: https://github.com/nlesc-sherlock/boatswain/commit/f8b85edd3ed9f21c04fa846eae1af7abed8d0d77
.. _0.2.0: https://github.com/nlesc-sherlock/boatswain/compare/f8b85ed...0.2.0
.. _0.3.0: https://github.com/nlesc-sherlock/boatswain/compare/0.2.0...0.3.0
.. _0.4.0: https://github.com/nlesc-sherlock/boatswain/compare/0.3.0...0.2.0
.. _0.5.0: https://github.com/nlesc-sherlock/boatswain/compare/0.4.0...0.5.0
.. _0.5.1: https://github.com/nlesc-sherlock/boatswain/compare/0.5.0...0.5.1
.. _0.6.0: https://github.com/nlesc-sherlock/boatswain/compare/0.5.1...0.6.0
.. _0.7.0: https://github.com/nlesc-sherlock/boatswain/compare/0.6.0...0.7.0
.. _1.0.0: https://github.com/nlesc-sherlock/boatswain/compare/0.7.0...1.0.0
.. _1.0.1: https://github.com/nlesc-sherlock/boatswain/compare/1.0.0...1.0.1
.. _1.0.2: https://github.com/nlesc-sherlock/boatswain/compare/1.0.1...1.0.2
:target: https://travis-ci.org/NLeSC/boatswain
.. image:: https://ci.appveyor.com/api/projects/status/5n7uj8ownch05e34/branch/master?svg=true
:target: https://ci.appveyor.com/project/NLeSC/boatswain/branch/master
.. image:: https://api.codacy.com/project/badge/Grade/67dac954463045d48541657bad72dcb2
:target: https://www.codacy.com/app/b-weel/boatswain?utm_source=github.com&utm_medium=referral&utm_content=nlesc-sherlock/boatswain&utm_campaign=Badge_Grade
.. image:: https://api.codacy.com/project/badge/Coverage/67dac954463045d48541657bad72dcb2
:target: https://www.codacy.com/app/b-weel/boatswain?utm_source=github.com&utm_medium=referral&utm_content=nlesc-sherlock/boatswain&utm_campaign=Badge_Coverage
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1149011.svg
:target: https://doi.org/10.5281/zenodo.1149011
Boatswain
=========
Boatswain is a simple build system for docker images.
It is especially usefull when you have multiple docker images that
depend on each other.
Installation
============
Boatswain is a simple python script you can install with pip
::
$ pip install boatswain
Usage
=====
Create a file called boatswain.yml for your project with the following
syntax, which is heavily based on docker-compose.
.. code-block:: yaml
version: 1.0 # The version of the boatswain yaml
organisation: boatswain # Your dockerhub organisation
images:
image1:pytest: # the key will be used to tag the image
context: docker/image1 # The path of the dockerfile
image2:pytest:
context: docker/image2
from: image1:pytest # This image depends on the other image
image3:pytest:
context: docker/image3
from: image2:pytest
image4:pytest:
context: docker/image4
tag: image12:pytest # This image will be tagged with this
Building
--------
You can build the images defined in the boatswain file using the following command. This invokes the docker build process for each image in the order so the dependencies are built before the dependent image.
::
$ boatswain build
Cleaning
--------
You can clean the images that are defined in the boatswain file.
::
$ boatswain clean
Pushing
-------
You can push the built images to dockerhub using the `push` command. It will be pushed to `organisation/imagetag` on dockerhub.
::
$ boatswain push
Extra Options
=============
-h
Display the options
-q, --quiet
Don't display any output
-k, --keep_building
Keep building images even if an error occurs
--dryrun
Do not actually execute the command, just go through the motions
-b <boatswain_file>, --boatswain_file <boatswain_file>
Override the default boatswain file (boatswain.yml)
-f, --force
Force building the images, even if they already exist
(only for build)
Debugging your build
====================
When your build does not go the way you expected boatswain
can display some more information by using:
-v
Verbose mode, displays a build progress for each image
-vv
Very verbose mode, displays the output of the docker build process
--debug
Debug mode, displays debug information of boatswain
as well as the output of the docker build process
==========
Change Log
==========
This document records all notable changes to Boatswain.
This project adheres to `Semantic Versioning <http://semver.org/>`_.
`1.0.2`_
* Added a non-zero exit code when a build fails
* Added a build summary show succesful and non-succesfully built images
* Added a keep-building (-k) command line argument
* Building now stops at the first failed image by default
`1.0.1`_
--------
* Fixed some packaging things
`1.0.0`_
-------
* Fixed help text of push command
* Fixed extraction of image id from docker response in some cases
* Windows compatibility
* Appveyor windows tests are passing
`0.7.0`_ (2017-04-03)
----------
* Added a 'before' and 'command' key to the build definition. This is a list of commands that need to be staged into the context directory.
* Default verbosity only shows 1 progress bar for all images
* Changed progress indication to full white block
`0.6.0`_ (2017-03-09)
--------------------
* Added the tree command which will print the tree of the boatswain file
* Added quiet and extra verbose modes
`0.5.1`_ (2017-02-10)
* Fixed issue with printing unicode text from the docker stream
`0.5.0`_ (2017-02-10)
---------------------
* Implemented push command
* Build will now greedily try to build images instead of throwing an exception at the first error.
* Added error messages to failing builds
* Standardized return values (e.g. always a list)
* Refactored to reduce code duplication in boatswain class
`0.4.0`_ (2017-02-09)
---------------------
* Progress timer now increases every second
* Improved error reporting (No longer uses an exception)
`0.3.0`_ (2017-02-08)
---------------------
* Added a whole bunch of tests
* Added the clean command
* Changed file layout from recursive to using from
`0.2.0`_ (2017-02-06)
---------------------
* Added dry-run option
* Added ability to build only one image
`0.1.0`_ (2017-02-02)
---------------------
* Initial release
.. _0.1.0: https://github.com/nlesc-sherlock/boatswain/commit/f8b85edd3ed9f21c04fa846eae1af7abed8d0d77
.. _0.2.0: https://github.com/nlesc-sherlock/boatswain/compare/f8b85ed...0.2.0
.. _0.3.0: https://github.com/nlesc-sherlock/boatswain/compare/0.2.0...0.3.0
.. _0.4.0: https://github.com/nlesc-sherlock/boatswain/compare/0.3.0...0.2.0
.. _0.5.0: https://github.com/nlesc-sherlock/boatswain/compare/0.4.0...0.5.0
.. _0.5.1: https://github.com/nlesc-sherlock/boatswain/compare/0.5.0...0.5.1
.. _0.6.0: https://github.com/nlesc-sherlock/boatswain/compare/0.5.1...0.6.0
.. _0.7.0: https://github.com/nlesc-sherlock/boatswain/compare/0.6.0...0.7.0
.. _1.0.0: https://github.com/nlesc-sherlock/boatswain/compare/0.7.0...1.0.0
.. _1.0.1: https://github.com/nlesc-sherlock/boatswain/compare/1.0.0...1.0.1
.. _1.0.2: https://github.com/nlesc-sherlock/boatswain/compare/1.0.1...1.0.2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
boatswain-1.0.2.tar.gz
(14.7 kB
view details)
Built Distribution
File details
Details for the file boatswain-1.0.2.tar.gz
.
File metadata
- Download URL: boatswain-1.0.2.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45ce7f2a720aba15118b259e4f8bde2604445111b4ec77bbd40e4e523ac68972 |
|
MD5 | 50130cc4cfea87f9af0e5ac53b844248 |
|
BLAKE2b-256 | dcfe1a59eb3267455be96d2531be1e32050d7819024e7740eed43d7f3c0b36fd |
File details
Details for the file boatswain-1.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: boatswain-1.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b76e5cf189b308262649621f1352ae5c39c3c767a6603b35c25aa227798b018b |
|
MD5 | aee27482f4b60f7a73f52e0f13d0f574 |
|
BLAKE2b-256 | 12cb52d31a0d3c5266fcc9603aa7bc290e9448b5212ffb78b5bbe1a9bf08f180 |