From 695fe3a1bfeefcf8477cf71909c1dc0c2965a252 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 20 Aug 2020 13:10:55 +0200 Subject: [PATCH] Initial version Signed-off-by: Knut Ahlers --- Dockerfile | 12 ++++++++++++ build.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 Dockerfile create mode 100755 build.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bc7b469 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM luzifer/archlinux + +LABEL maintainer Knut Ahlers + +COPY build.sh /usr/local/bin/ + +RUN set -ex \ + && /usr/local/bin/build.sh + +ENTRYPOINT ["/usr/local/bin/inner-runner"] +CMD ["--"] + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..4b97b8b --- /dev/null +++ b/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -euxo pipefail + +# Packages required to build the image +pkg_build=( + jq +) + +# Packages kept for the final image +pkg_img=( + ca-certificates + curl + docker + git + make +) + +# Install required packages +pacman -Syyu --noconfirm +pacman -S --noconfirm "${pkg_build[@]}" "${pkg_img[@]}" + +function get_asset_url() { + curl -sSfL "https://api.github.com/repos/${1}/releases/latest" | + jq -r '.assets | .[] | .browser_download_url' | + grep -E 'linux.*amd64.tar.gz' +} + +# Download latest release of inner-runner +curl -sSfL "$(get_asset_url repo-runner/repo-runner | grep inner-runner)" | tar -xzf - -C /usr/local/bin +mv /usr/local/bin/inner-runner* /usr/local/bin/inner-runner + +# Purge build-packages +pacman -Rs --noconfirm "${pkg_build[@]}"