Skip to content

Instantly share code, notes, and snippets.

@mishak87
Last active August 29, 2015 14:17
Show Gist options
  • Save mishak87/2a68509548c2a2f5c63f to your computer and use it in GitHub Desktop.
Save mishak87/2a68509548c2a2f5c63f to your computer and use it in GitHub Desktop.
Building multiple versions docker-library/<project> using Makefile

Simple tool for building/uploading multiple versions of docker-library/ like projects

Default directory structure

[docker/]<main.minor>[/<optional>]/Dockerfile

1.) Collect tags

foreach <main>.<minor>
    if -f <main>.<minor>/Dockerfile
        tags[<main>.<minor>]=<main>.<minor>
        if MAX(<main>.*, minor) == <minor>
            tags[<main>]=tags[<main>.<minor>]
            if MAX(*.*, main) == <main>
                tags[latest]=tags[<main>.<minor>]
    foreach <main>.<minor>/<optional>
        if -f <main>.<minor>/<optional>/Dockerfile
            tags[<main>.<minor>-<optional>]=<main>.<minor>/<optional>
            if tags[<main>] == tags[<main>.<minor>]
                tags[<main>-<optional>]=tags[<main>.<minor>-<optional>]

2.) Compute dependencies

3.) Action

Generate Makefile

Update settings

Bump build version

Build images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment