Package: shipwright
Shipwright builds shared Docker images within a git repository inthe
right orderand publishes them tagged with git’s revision/branch
information so you’ll never loose track of an image’s origin.It’s the perfect tool for building and publishing your images to places
like Docker Hub or your own private registry. Have a look atour
motivationto see why we built it and the pain
points it solves for you.InstallationShipwright is a simple python script you can install with pip$ pip install shipwrightQuickstartOnce installed, simply change to a project of yours that contains
multiple Dockerfiles and is in git.Add a json formatted file named.shipwright.jsonto the root
directory of your project. At minimum it should contain the version
number of your Shipwright config and anamespacewhich is either
your docker hub user name or the URL to your private repository.1.0 is the current version for the config.{"version":1.0,"namespace":"[your docker hub name or private repository]"}Additionally your config file can map directory names to alternative
docker repositories. For example here is a.shipwright.jsonfor the
docker hub usershipwrightthat also maps the root of the git
repository to the docker imageshipwright/sharedand the/foodirectory toshipwright/awesome_sauce.{"version":1.0,"namespace":"shipwright","names":{"/":"shipwright/shared","/foo":"shipwright/awesome_sauce"}Now you can build all the docker images in the git repo by simply
changing to any directory under your git repo and running:$ shipwrightThis will recurse through all the directories, looking for ones that
contain a Dockerfile. Shipwright will build these Dockerfiles in order
and by default tag them with<namespace>/<dirname>:<gitcommit>along with<namespace>/<dirname>:<gitbranch>and<namespace>/<dirname>:latestWorking exampleWe havea sample shipwright
projectyou can use if you
want to try this out right away.$gitclonehttps://github.com/6si/shipwright-sample.git$cdshipwright-sample$shipwrightNOTE: you can use any username you’d like while building locally. In
the above example we use ``shipwright``. Nothing is published unless you
use the ``push`` command. For your own projects, substitute
``shipwright`` in the above example with your (or your organizations)
official docker hub username or private repository.Notice that if you run theshipwrighta second time it will return
immediately without doing anything. Shipwright is smart enough to know
nothing has changed.Shipwright really shines when you switch git branches.$gitcheckoutnew_feature$shipwrightNotice that shipwright only rebuilt the shared library and service1,
ignoring the other projects because they have a common git ancestry.
Runningdocker imageshowever shows that all the images in the git
repository have been tagged with the latest git revision, branch andlatest.In fact, as Shipwright builds images it rewrites the Dockerfiles so
that they require the base images with tags from the current git
revision. This ensures that the entire build is deterministic and
reproducible.BuildingBy default, if you run shipwright with no arguments, it will build all
Dockerfiles in your git repo. You can specify one or morespecifiersto select fewer images to build. For example you can build a single
images and its dependencies by simply specifying its name on the command
line.$ shipwright <namespace>/some_imageRun `shipwright –help’ for more examples of specifiers and their uses.PublishingWith one command Shipwright can build your images and push them to a
remote repository.$ shipwright pushIf you like you can just push your latest images without building.$ shipwright push --no-buildThe same specifiers for building also work withpush. You might use
this to build an entire tree in one step then push a specific image like
so.$ shipwright build
$ shipwright push -e <namespace>/public_image0.9.0 (2017-06-29)Add better fast-alias error message for missing manifest.
(Issue #103).Retry on error during docker push.
(Issue #104).Pull parent images before build to avoid problems with
docker-py build not sending credentials.
(Issue #102).Push and tag images as soon as they are built.
(Issue #101).Base the cache key on the globs in Docker COPY/ADD commands.
(Issue #98).0.8.0 (2017-06-08)Add proper stack traces for direct registry errors.
(Issue #93).Handle differences between docker over TCP and Unix socket.
(Issue #96).Mark every internal package as private to allow exporting
of select parts of shipwright publicly.
(Issue #99).Create shipwright.targets.targets function to list available
docker targets in a repo programaticaly.
(Issue #100).0.7.0 (2017-01-13)Depend on docker>=2.0.1.
(Issue #91).0.6.6 (2017-01-13)Exprimental –registry-login cache flag to skip creation of already built
images and speed up tagging. Feature not subject to semver.
(Issue #89).0.6.5 (2017-01-08)Fix changelog.0.6.4 (2017-01-08)Add images command for creating docker save.
(Issue #88).0.6.3 (2016-08-24)Push images to the registry in parallel.
(Issue #82).0.6.2 (2016-08-23)Also push image target ref so that –pull-cache can pull them.
(Issue #81).0.6.1 (2016-08-23)Warn on –pull-cache errors
(Issue #80).0.6.0 (2016-08-22)Add –pull-cache to pull images from repository before building.
(Issue #49).0.5.0 (2016-08-19)Add –dirty to build from working tree, even when uncommitted and untracked changes exist.
(Issue #74).
ThanksJames Pickering!Ignore images without RepoTags when gathering built_tags to fix a crash
caused by docker images pulled via RepoDigest.
(Issue #77).
Thankskgpayne!0.4.2 (2016-06-16)Correct naming, shipwright builds docker images.
(Issue #71)Allow building with a detached HEAD
(Issue #72)0.4.1 (2016-06-15)Fix push crash. (Issue #70)0.4.0 (2016-06-13)Isolate all git functionality, so as to create pluggable Source Control wrappers.More efficient required build detection. (Issue #63)Isolate all zipper usage, vendor zipper library.0.2.2 (2015-01-07)Fix bug missingtlswhen communicating with docker over a unix
socket.0.2.1 (2015-01-01)Force tag to support docker 1.4.1Requries docker-py >= 0.6Addedassert_hostnameas an option to.shipwright.jsonAdded command line option--x-assert-hostnameto disable hostname
checking when TLS is used. Useful for boot2docker0.2.0 (2014-12-31)Addedshipwright pushandshipwright purgeAdded support for specifiers-u,-d,-eand-x0.1.0 (2014-09-10)Build and tag containersMoved config to.shipwright.json