From ff8ca4dfd310365c7a05b42e14e6b39a84c58f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20M=C3=A4nnchen?= Date: Thu, 21 Nov 2019 18:40:51 +0100 Subject: [PATCH] WIP: Use Hex.pm/Bob to build images --- 1.2/Dockerfile | 23 ---- 1.2/onbuild/Dockerfile | 3 - 1.2/slim/Dockerfile | 25 ---- 1.3/Dockerfile | 23 ---- 1.3/onbuild/Dockerfile | 3 - 1.3/slim/Dockerfile | 25 ---- 1.4/Dockerfile | 22 ---- 1.4/onbuild/Dockerfile | 3 - 1.4/slim/Dockerfile | 25 ---- 1.5/Dockerfile | 18 --- 1.5/alpine/Dockerfile | 22 ---- 1.5/slim/Dockerfile | 24 ---- 1.6/Dockerfile | 18 --- 1.6/alpine/Dockerfile | 22 ---- 1.6/otp-21-alpine/Dockerfile | 26 ----- 1.6/otp-21/Dockerfile | 18 --- 1.6/slim/Dockerfile | 24 ---- 1.7/Dockerfile | 18 --- 1.7/alpine/Dockerfile | 25 ---- 1.7/otp-21.2-alpine/Dockerfile | 25 ---- 1.7/otp-21.2/Dockerfile | 18 --- 1.7/slim/Dockerfile | 27 ----- 1.8/Dockerfile | 18 --- 1.8/alpine/Dockerfile | 25 ---- 1.8/otp-21.2-alpine/Dockerfile | 25 ---- 1.8/otp-21.2/Dockerfile | 18 --- 1.8/otp-22-alpine/Dockerfile | 25 ---- 1.8/otp-22/Dockerfile | 18 --- 1.8/slim/Dockerfile | 27 ----- 1.9/Dockerfile | 18 --- 1.9/alpine/Dockerfile | 25 ---- 1.9/slim/Dockerfile | 27 ----- Dockerfile | 24 ++++ build-all | 207 +++++++++++++++++++++++++++++++++ master/Dockerfile | 19 --- 35 files changed, 231 insertions(+), 682 deletions(-) delete mode 100644 1.2/Dockerfile delete mode 100644 1.2/onbuild/Dockerfile delete mode 100644 1.2/slim/Dockerfile delete mode 100644 1.3/Dockerfile delete mode 100644 1.3/onbuild/Dockerfile delete mode 100644 1.3/slim/Dockerfile delete mode 100644 1.4/Dockerfile delete mode 100644 1.4/onbuild/Dockerfile delete mode 100644 1.4/slim/Dockerfile delete mode 100644 1.5/Dockerfile delete mode 100644 1.5/alpine/Dockerfile delete mode 100644 1.5/slim/Dockerfile delete mode 100644 1.6/Dockerfile delete mode 100644 1.6/alpine/Dockerfile delete mode 100644 1.6/otp-21-alpine/Dockerfile delete mode 100644 1.6/otp-21/Dockerfile delete mode 100644 1.6/slim/Dockerfile delete mode 100644 1.7/Dockerfile delete mode 100644 1.7/alpine/Dockerfile delete mode 100644 1.7/otp-21.2-alpine/Dockerfile delete mode 100644 1.7/otp-21.2/Dockerfile delete mode 100644 1.7/slim/Dockerfile delete mode 100644 1.8/Dockerfile delete mode 100644 1.8/alpine/Dockerfile delete mode 100644 1.8/otp-21.2-alpine/Dockerfile delete mode 100644 1.8/otp-21.2/Dockerfile delete mode 100644 1.8/otp-22-alpine/Dockerfile delete mode 100644 1.8/otp-22/Dockerfile delete mode 100644 1.8/slim/Dockerfile delete mode 100644 1.9/Dockerfile delete mode 100644 1.9/alpine/Dockerfile delete mode 100644 1.9/slim/Dockerfile create mode 100644 Dockerfile create mode 100755 build-all delete mode 100644 master/Dockerfile diff --git a/1.2/Dockerfile b/1.2/Dockerfile deleted file mode 100644 index 1b5086c..0000000 --- a/1.2/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ - -FROM erlang:18 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.2.6" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION#*@}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="bb4324eb7c9568fa30f0f2ed3c1b86ebbd5251f7c820f1beb0e5eed5fb8a9729" \ - && buildDeps=' \ - unzip \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.2/onbuild/Dockerfile b/1.2/onbuild/Dockerfile deleted file mode 100644 index 36cf653..0000000 --- a/1.2/onbuild/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ - -FROM elixir:1.2 - diff --git a/1.2/slim/Dockerfile b/1.2/slim/Dockerfile deleted file mode 100644 index d6e32aa..0000000 --- a/1.2/slim/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ - -FROM erlang:18-slim - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.2.6" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION#*@}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="bb4324eb7c9568fa30f0f2ed3c1b86ebbd5251f7c820f1beb0e5eed5fb8a9729" \ - && buildDeps=' \ - ca-certificates \ - curl \ - unzip \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.3/Dockerfile b/1.3/Dockerfile deleted file mode 100644 index bd14387..0000000 --- a/1.3/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ - -FROM erlang:19 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.3.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="eac16c41b88e7293a31d6ca95b5d72eaec92349a1f16846344f7b88128587e10"\ - && buildDeps=' \ - unzip \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.3/onbuild/Dockerfile b/1.3/onbuild/Dockerfile deleted file mode 100644 index e288422..0000000 --- a/1.3/onbuild/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ - -FROM elixir:1.3 - diff --git a/1.3/slim/Dockerfile b/1.3/slim/Dockerfile deleted file mode 100644 index e8599bc..0000000 --- a/1.3/slim/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ - -FROM erlang:19-slim - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.3.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="eac16c41b88e7293a31d6ca95b5d72eaec92349a1f16846344f7b88128587e10" \ - && buildDeps=' \ - ca-certificates \ - curl \ - unzip \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.4/Dockerfile b/1.4/Dockerfile deleted file mode 100644 index 5fe377b..0000000 --- a/1.4/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM erlang:19 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.4.5" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="a740e634e3c68b1477e16d75a0fd400237a46c62ceb5d04551dbc46093a03f98"\ - && buildDeps=' \ - unzip \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.4/onbuild/Dockerfile b/1.4/onbuild/Dockerfile deleted file mode 100644 index 31d4c4e..0000000 --- a/1.4/onbuild/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ - -FROM elixir:1.4 - diff --git a/1.4/slim/Dockerfile b/1.4/slim/Dockerfile deleted file mode 100644 index 8e20599..0000000 --- a/1.4/slim/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ - -FROM erlang:19-slim - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.4.5" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="a740e634e3c68b1477e16d75a0fd400237a46c62ceb5d04551dbc46093a03f98"\ - && buildDeps=' \ - ca-certificates \ - curl \ - unzip \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.5/Dockerfile b/1.5/Dockerfile deleted file mode 100644 index 8de6715..0000000 --- a/1.5/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:20 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.5.3" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="0fc6024b6027d87af9609b416448fd65d8927e0d05fc02410b35f4b9b9eb9629" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.5/alpine/Dockerfile b/1.5/alpine/Dockerfile deleted file mode 100644 index 950919e..0000000 --- a/1.5/alpine/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM erlang:20-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.5.3" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="70972b844c12bc1a3960136d628ab4f21ca87dd5539c544ebabe41d6c9239ba9" \ - && buildDeps=' \ - ca-certificates \ - curl \ - unzip \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apk del .build-deps - -CMD ["iex"] diff --git a/1.5/slim/Dockerfile b/1.5/slim/Dockerfile deleted file mode 100644 index ca991e4..0000000 --- a/1.5/slim/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM erlang:20-slim - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.5.3" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="70972b844c12bc1a3960136d628ab4f21ca87dd5539c544ebabe41d6c9239ba9" \ - && buildDeps=' \ - ca-certificates \ - curl \ - unzip \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.6/Dockerfile b/1.6/Dockerfile deleted file mode 100644 index ed0dde2..0000000 --- a/1.6/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:20 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.6.6" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="74507b0646bf485ee3af0e7727e3fdab7123f1c5ecf2187a52a928ad60f93831" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.6/alpine/Dockerfile b/1.6/alpine/Dockerfile deleted file mode 100644 index 1175f5d..0000000 --- a/1.6/alpine/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM erlang:20-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.6.6" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="d6a84726a042407110d3b13b1ce8d9524b4a50df68174e79d89a9e42e30b410b" \ - && buildDeps=' \ - ca-certificates \ - curl \ - unzip \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apk del .build-deps - -CMD ["iex"] diff --git a/1.6/otp-21-alpine/Dockerfile b/1.6/otp-21-alpine/Dockerfile deleted file mode 100644 index 488f3f7..0000000 --- a/1.6/otp-21-alpine/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM erlang:21-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.6.6" \ - LANG=C.UTF-8 - -# the OTP_VERSION is env set from erlang images, has values like `21.0.3` -RUN set -xe \ - && OTP_MAJOR_VERSION="${OTP_VERSION%%.*}" \ - && ELIXIR_DOWNLOAD_URL="https://repo.hex.pm/builds/elixir/${ELIXIR_VERSION}-otp-${OTP_MAJOR_VERSION}.zip" \ - && ELIXIR_DOWNLOAD_SHA256="72ba3a058c1e0986f0eaec738739e3ff8852b2f73c45b76ad9d9e0f2b4b8a729" \ - && buildDeps=' \ - ca-certificates \ - curl \ - unzip \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apk del .build-deps \ - && mix local.hex --force \ - && mix local.rebar --force - -CMD ["iex"] diff --git a/1.6/otp-21/Dockerfile b/1.6/otp-21/Dockerfile deleted file mode 100644 index cb64631..0000000 --- a/1.6/otp-21/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:21 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.6.6" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="74507b0646bf485ee3af0e7727e3fdab7123f1c5ecf2187a52a928ad60f93831" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.6/slim/Dockerfile b/1.6/slim/Dockerfile deleted file mode 100644 index d48888d..0000000 --- a/1.6/slim/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM erlang:20-slim - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.6.6" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip" \ - && ELIXIR_DOWNLOAD_SHA256="d6a84726a042407110d3b13b1ce8d9524b4a50df68174e79d89a9e42e30b410b" \ - && buildDeps=' \ - ca-certificates \ - curl \ - unzip \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-precompiled.zip $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-precompiled.zip" | sha256sum -c - \ - && unzip -d /usr/local elixir-precompiled.zip \ - && rm elixir-precompiled.zip \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.7/Dockerfile b/1.7/Dockerfile deleted file mode 100644 index d2554ba..0000000 --- a/1.7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:21 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.7.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="c7c87983e03a1dcf20078141a22355e88dadb26b53d3f3f98b9a9268687f9e20" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.7/alpine/Dockerfile b/1.7/alpine/Dockerfile deleted file mode 100644 index 05f383f..0000000 --- a/1.7/alpine/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM erlang:21-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.7.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="c7c87983e03a1dcf20078141a22355e88dadb26b53d3f3f98b9a9268687f9e20" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apk del .build-deps - -CMD ["iex"] diff --git a/1.7/otp-21.2-alpine/Dockerfile b/1.7/otp-21.2-alpine/Dockerfile deleted file mode 100644 index 8e4616a..0000000 --- a/1.7/otp-21.2-alpine/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM erlang:21.2-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.7.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="c7c87983e03a1dcf20078141a22355e88dadb26b53d3f3f98b9a9268687f9e20" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apk del .build-deps - -CMD ["iex"] diff --git a/1.7/otp-21.2/Dockerfile b/1.7/otp-21.2/Dockerfile deleted file mode 100644 index 5b3a563..0000000 --- a/1.7/otp-21.2/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:21.2 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.7.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="c7c87983e03a1dcf20078141a22355e88dadb26b53d3f3f98b9a9268687f9e20" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.7/slim/Dockerfile b/1.7/slim/Dockerfile deleted file mode 100644 index 2411291..0000000 --- a/1.7/slim/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM erlang:21-slim - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.7.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="c7c87983e03a1dcf20078141a22355e88dadb26b53d3f3f98b9a9268687f9e20" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.8/Dockerfile b/1.8/Dockerfile deleted file mode 100644 index f00e562..0000000 --- a/1.8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:21 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.8.2" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="cf9bf0b2d92bc4671431e3fe1d1b0a0e5125f1a942cc4fdf7914b74f04efb835" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.8/alpine/Dockerfile b/1.8/alpine/Dockerfile deleted file mode 100644 index 313cc9e..0000000 --- a/1.8/alpine/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM erlang:21-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.8.2" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="cf9bf0b2d92bc4671431e3fe1d1b0a0e5125f1a942cc4fdf7914b74f04efb835" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apk del .build-deps - -CMD ["iex"] diff --git a/1.8/otp-21.2-alpine/Dockerfile b/1.8/otp-21.2-alpine/Dockerfile deleted file mode 100644 index b0c451c..0000000 --- a/1.8/otp-21.2-alpine/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM erlang:21.2-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.8.2" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="cf9bf0b2d92bc4671431e3fe1d1b0a0e5125f1a942cc4fdf7914b74f04efb835" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apk del .build-deps - -CMD ["iex"] diff --git a/1.8/otp-21.2/Dockerfile b/1.8/otp-21.2/Dockerfile deleted file mode 100644 index 52e4178..0000000 --- a/1.8/otp-21.2/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:21.2 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.8.2" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="cf9bf0b2d92bc4671431e3fe1d1b0a0e5125f1a942cc4fdf7914b74f04efb835" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.8/otp-22-alpine/Dockerfile b/1.8/otp-22-alpine/Dockerfile deleted file mode 100644 index 1943ec7..0000000 --- a/1.8/otp-22-alpine/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM erlang:22-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.8.2" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="cf9bf0b2d92bc4671431e3fe1d1b0a0e5125f1a942cc4fdf7914b74f04efb835" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apk del .build-deps - -CMD ["iex"] diff --git a/1.8/otp-22/Dockerfile b/1.8/otp-22/Dockerfile deleted file mode 100644 index 011c34b..0000000 --- a/1.8/otp-22/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:22 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.8.2" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="cf9bf0b2d92bc4671431e3fe1d1b0a0e5125f1a942cc4fdf7914b74f04efb835" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.8/slim/Dockerfile b/1.8/slim/Dockerfile deleted file mode 100644 index 1e910e0..0000000 --- a/1.8/slim/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM erlang:21-slim - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.8.2" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="cf9bf0b2d92bc4671431e3fe1d1b0a0e5125f1a942cc4fdf7914b74f04efb835" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/1.9/Dockerfile b/1.9/Dockerfile deleted file mode 100644 index d9449c7..0000000 --- a/1.9/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM erlang:22 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.9.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="f3465d8a8e386f3e74831bf9594ee39e6dfde6aa430fe9260844cfe46aa10139" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean - -CMD ["iex"] diff --git a/1.9/alpine/Dockerfile b/1.9/alpine/Dockerfile deleted file mode 100644 index 170876a..0000000 --- a/1.9/alpine/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM erlang:22-alpine - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.9.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="f3465d8a8e386f3e74831bf9594ee39e6dfde6aa430fe9260844cfe46aa10139" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apk add --no-cache --virtual .build-deps $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apk del .build-deps - -CMD ["iex"] diff --git a/1.9/slim/Dockerfile b/1.9/slim/Dockerfile deleted file mode 100644 index 4910913..0000000 --- a/1.9/slim/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM erlang:22-slim - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.9.4" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="f3465d8a8e386f3e74831bf9594ee39e6dfde6aa430fe9260844cfe46aa10139" \ - && buildDeps=' \ - ca-certificates \ - curl \ - make \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make install clean \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* - -CMD ["iex"] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7f0a561 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +ARG OTP_MAJOR_VERSION=22 +ARG VARIATION_MODIFIER="" + +FROM ubuntu as downloader_extractor + +RUN apt-get update && apt-get install -y unzip + +ARG VERSION_NAME="v1.9.4-otp-22" + +ADD "https://repo.hex.pm/builds/elixir/${VERSION_NAME}.zip" /tmp/elixir-precompiled.zip + +RUN mkdir /elixir \ + && unzip -d /elixir /tmp/elixir-precompiled.zip + +ARG OTP_MAJOR_VERSION=22 +ARG VARIATION_MODIFIER="" +FROM erlang:${OTP_MAJOR_VERSION}${VARIATION_MODIFIER} + +# elixir expects utf8. +ENV LANG=C.UTF-8 + +COPY --from=downloader_extractor /elixir/ /usr/local/ + +CMD ["iex"] diff --git a/build-all b/build-all new file mode 100755 index 0000000..09d1d66 --- /dev/null +++ b/build-all @@ -0,0 +1,207 @@ +#!/bin/bash + +set -e + +function load_builds { + curl -s https://repo.hex.pm/builds/elixir/builds.txt +} + +function is_v0 { + [ "$(echo "$1" | cut -c1-2)" == "v0" ] +} + +function has_otp { + [[ "$1" =~ -otp- ]] +} + +function is_stable { + [[ "$1" =~ ^v ]] && [[ ! "$1" =~ rc ]] +} + +function extract_minor { + [[ "$1" =~ ^(v[0-9]+\.[0-9]+)\.[0-9]+$ ]] +} + +function extract_major { + [[ "$1" =~ ^(v[0-9]+)\.[0-9]+\.[0-9]+$ ]] +} + +function full_version_or_no_version { + [[ "$1" =~ ^[^v] ]] || [[ "$1" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]] +} + +function variations_for_otp { + case "$1" in + 1[0-9]) + echo "default,slim" + ;; + 2[0-9]) + echo "default,slim,alpine" + ;; + esac +} + +function enrich_otp_information { + while IFS=" " read -r VERSION_NAME _ _; do + if has_otp "$VERSION_NAME"; then + echo "$VERSION_NAME $VERSION_NAME" + elif is_v0 "$VERSION_NAME"; then + echo "$VERSION_NAME $VERSION_NAME-otp-17" + fi + done +} + +function split_otp_version { + while IFS=" " read -r VERSION_NAME VERSION_NAME_WITH_OTP; do + [[ "$VERSION_NAME_WITH_OTP" =~ ^(.+)-otp-(.+)$ ]] + echo "$VERSION_NAME ${BASH_REMATCH[1]} ${BASH_REMATCH[2]}" + done +} + +function add_base_tags { + while IFS=" " read -r VERSION_NAME ELIXIR_VERSION OTP_MAJOR_VERSION; do + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $ELIXIR_VERSION" + done +} + +function remove_partial_versions { + while IFS=" " read -r VERSION_NAME ELIXIR_VERSION OTP_MAJOR_VERSION TAGS; do + if full_version_or_no_version "$ELIXIR_VERSION"; then + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS" + fi + done +} + +function add_minor_tag { + LAST_MINOR="" + + while IFS=" " read -r VERSION_NAME ELIXIR_VERSION OTP_MAJOR_VERSION TAGS; do + if extract_minor "$ELIXIR_VERSION"; then + MINOR="${BASH_REMATCH[1]}" + + # Same Minor as before + if [ "$MINOR" == "$LAST_MINOR" ]; then + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS" + # New minor with no separate entry in list + else + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS,$MINOR" + LAST_MINOR="$MINOR" + fi + else + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS" + fi + done +} + +function add_major_tag { + LAST_MAJOR="" + + while IFS=" " read -r VERSION_NAME ELIXIR_VERSION OTP_MAJOR_VERSION TAGS; do + if extract_major "$ELIXIR_VERSION"; then + MAJOR="${BASH_REMATCH[1]}" + + # Same major as before + if [ "$MAJOR" == "$LAST_MAJOR" ]; then + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS" + # New major with no separate entry in list + else + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS,$MAJOR" + LAST_MAJOR="$MAJOR" + fi + else + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS" + fi + done +} + +function add_latest_tag { + FOUND=0 + + while IFS=" " read -r VERSION_NAME ELIXIR_VERSION OTP_MAJOR_VERSION TAGS; do + if [ $FOUND -eq 0 ] && is_stable "$ELIXIR_VERSION"; then + FOUND=1 + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS,latest" + else + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS" + fi + done +} + +function add_tags_otp_suffix { + LAST_VERSION="" + while IFS=" " read -r VERSION_NAME ELIXIR_VERSION OTP_MAJOR_VERSION TOP_LEVEL_TAGS; do + if [ "$ELIXIR_VERSION" != "$LAST_VERSION" ]; then + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TOP_LEVEL_TAGS" + LAST_VERSION="$ELIXIR_VERSION" + fi + + TAGS="" + for TOP_LEVEL_TAG in ${TOP_LEVEL_TAGS//,/ }; do + TAGS="$TAGS,$TOP_LEVEL_TAG-otp-$OTP_MAJOR_VERSION" + done + TAGS="${TAGS:1}" + + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS" + done +} + +function add_variations { + while IFS=" " read -r VERSION_NAME ELIXIR_VERSION OTP_MAJOR_VERSION TAGS; do + for VARIATION in $(variations_for_otp "$OTP_MAJOR_VERSION" | sed "s/,/ /g"); do + if [ "$VARIATION" == "default" ]; then + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $TAGS $VARIATION" + else + VARIATION_TAGS="" + for TAG in ${TAGS//,/ }; do + if [ "$TAG" == "latest" ]; then + VARIATION_TAGS="$VARIATION_TAGS,$VARIATION" + else + VARIATION_TAGS="$VARIATION_TAGS,$TAG-$VARIATION" + fi + done + VARIATION_TAGS="${VARIATION_TAGS:1}" + echo "$VERSION_NAME $ELIXIR_VERSION $OTP_MAJOR_VERSION $VARIATION_TAGS $VARIATION" + fi + done + done +} + +function build { + while IFS=" " read -r VERSION_NAME ELIXIR_VERSION OTP_MAJOR_VERSION TAGS VARIATION; do + TAG_ARGS=() + for TAG in ${TAGS//,/ }; do + TAG_ARGS+=(-t "elixir:${TAG}") + done + + if [ "$VARIATION" == "default" ]; then + VARIATION_MODIFIER="" + else + VARIATION_MODIFIER="-${VARIATION}" + fi + + echo "Building elixir:$TAG" + + docker build "${TAG_ARGS[@]}" \ + --build-arg VERSION_NAME="$VERSION_NAME" \ + --build-arg OTP_MAJOR_VERSION="$OTP_MAJOR_VERSION" \ + --build-arg VARIATION_MODIFIER="$VARIATION_MODIFIER" \ + --quiet \ + . + + docker run "elixir:${TAG[0]}" elixir --version > /dev/null 2>&1 && echo "Elixir Responds" + done +} + + +load_builds \ + | enrich_otp_information \ + | split_otp_version \ + | add_base_tags \ + | tac \ + | remove_partial_versions \ + | add_minor_tag \ + | add_major_tag \ + | add_latest_tag \ + | add_tags_otp_suffix \ + | add_variations \ + | build \ No newline at end of file diff --git a/master/Dockerfile b/master/Dockerfile deleted file mode 100644 index 41c0a18..0000000 --- a/master/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM erlang:21 - -# elixir expects utf8. -ENV ELIXIR_VERSION="v1.9.0-dev@cee233c" \ - LANG=C.UTF-8 - -RUN set -xe \ - && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION#*@}.tar.gz" \ - && ELIXIR_DOWNLOAD_SHA256="09396308e583cee2eaa89ee928e6b217f2d345e0a9dfca5b35765cb50f50981a" \ - && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ - && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/local/src/elixir \ - && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ - && rm elixir-src.tar.gz \ - && cd /usr/local/src/elixir \ - && make -j$(nproc) \ - && make install clean - -CMD ["iex"]