v0.2.0
Migration Instructions
-
beaver install
You should move to use a
beaver.Dockerfile
unless you really need some
customization that is not supported bybeaver docker gen-dockerfile
. Please
read the New Features notes to see how to use this. -
beaver dlang install
This command use a much more automated approach to building the image, by
using abeaver.Dockerfile
anddocker/build
script (likebeaver install
).Note that, on the contrary to
beaver install
this command won't fall
back to use aDockerfile.$DIST
, so you need to migrate to the new scheme.
Features
-
beaver docker gen-dockerfile
The
docker
command learned a new subcommand to generate aDockerfile
based
on abeaver.Dockerfile
(by default). Please look readbeaver docker gen-dockerfile -h
for more options and information on how the file is
actually generated. -
beaver dlang install
This command, as
beaver install
, learned to use thebeaver.Dockerfile
to
generate theDockerfile
. Please read the changes inbeaver install
to
learn how to use this feature.This command works exactly like
beaver install
but it adds more sugar on
top. It will install the DMD version as requested via theDMD
environment
variable (by injecting theDMD_PKG
variable to the docker image generation,
as well as callingapt-get update && apt-get install
with the requested DMD
version for you.This means you only have to take care of installing your project dependencies
and you don't need to do anapt-get update
before the install.Here is an example
beaver.Dockerfile
anddocker/build
script when using
beaver dlang install
:FROM sociomantictsunami/dlang:v2
#!/bin/sh apt-get install -f libwhatever-dev tool
Again, if you don't need extra dependencies, you can completely omit the
docker/build
script.Note that
beaver dlang install
won't fall back to use
aDockerfile.$DIST
. -
beaver install
This command learned to use the
beaver.Dockerfile
to generate the
Dockerfile
. TheDockerfile.$DIST
still has precedence over the
beaver.Dockerfile
in case you really need to customize theDockerfile
in
a way thatbeaver docker gen-dockerfile
is not enough.By using a
beaver.Dockerfile
you can just use one docker image building
specification for multiple base distributions. Yourbeaver.Dockerfile
only
needs to define aFROM
line in a special way, only using as the tag, the
image version without the distribution name.So if you want to use
sociomantictsunami/dlang:{trusty,xenial}-v2
, you
should use:FROM sociomantictsunami/dlang:v2
Of course you can use other
Dockerfile
instructions here as needed.The
beaver install
command will automatically inject the appropriate
distro name and some final instructions to copy everything in thedocker/
directory to the image and run thedocker/build
script so you just need to
care to write a script to build the image (make sure it is executable). In the
script you can always use$(lsb_release -cs)
to the what the current Ubuntu
version is and install different packages based on that, for example.Here is a sample script:
#!/bin/sh set -xeu apt-get update if test "$(lsb_release -cs)" = trusty then apt-get install -y python2 else apt-get install -y python3 fi
You can completely omit the
docker/build
script if you don't need any extra
build steps - if the script doesn't exist, nothing will be copied to the image
building procedure either.