Skip to content

v0.2.0

Compare
Choose a tag to compare
@leandro-lucarella-sociomantic leandro-lucarella-sociomantic released this 16 Aug 16:26
· 63 commits to v0.6.x since this release
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 by beaver 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 a beaver.Dockerfile and docker/build script (like beaver install).

    Note that, on the contrary to beaver install this command won't fall
    back to use a Dockerfile.$DIST, so you need to migrate to the new scheme.

Features

  • beaver docker gen-dockerfile

    The docker command learned a new subcommand to generate a Dockerfile based
    on a beaver.Dockerfile (by default). Please look read beaver 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 the beaver.Dockerfile to
    generate the Dockerfile. Please read the changes in beaver 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 the DMD environment
    variable (by injecting the DMD_PKG variable to the docker image generation,
    as well as calling apt-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 an apt-get update before the install.

    Here is an example beaver.Dockerfile and docker/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
    a Dockerfile.$DIST.

  • beaver install

    This command learned to use the beaver.Dockerfile to generate the
    Dockerfile. The Dockerfile.$DIST still has precedence over the
    beaver.Dockerfile in case you really need to customize the Dockerfile in
    a way that beaver docker gen-dockerfile is not enough.

    By using a beaver.Dockerfile you can just use one docker image building
    specification for multiple base distributions. Your beaver.Dockerfile only
    needs to define a FROM 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 the docker/
    directory to the image and run the docker/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.