diff --git a/Dockerfile b/Dockerfile index 935461b..36f07c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,9 @@ -FROM debian +FROM debian:stretch -ENV REPO_RUNNER_VERSION=v0.11.0 \ - DOCKER_VERSION=17.09.0-ce - -ADD https://github.com/Luzifer/repo-runner/releases/download/${REPO_RUNNER_VERSION}/inner-runner_linux_amd64 /usr/local/bin/inner-runner +LABEL maintainer Knut Ahlers +COPY build.sh /usr/local/bin/ RUN set -ex \ - && apt-get update && apt-get install -y make curl git \ - && curl -sSL https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz | tar -xz -C /usr/local/bin --strip-components=1 \ - && chmod +x /usr/local/bin/inner-runner + && /usr/local/bin/build.sh ENTRYPOINT ["/usr/local/bin/inner-runner"] diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..a13658e --- /dev/null +++ b/build.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -euxo pipefail + +export DEBIAN_FRONTEND=noninteractive + +# Install required utils +apt-get update +apt-get install -y --no-install-recommends \ + apt-transport-https \ + ca-certificates \ + curl \ + dirmngr \ + git \ + gnupg \ + jq \ + lsb-release \ + make + +# Download latest release of inner-runner +DOWNLOAD=$(curl -sSfL https://api.github.com/repos/repo-runner/repo-runner/releases/latest | + jq -r '.assets | .[] | select(.name == "inner-runner_linux_amd64.tar.gz") | .browser_download_url') +curl -sSfL "${DOWNLOAD}" | tar -xzf - -C /usr/local/bin +mv /usr/local/bin/inner-runner* /usr/local/bin/inner-runner + +# Install docker-ce +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 + +echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -sc) stable" >/etc/apt/sources.list.d/docker.list +apt-get update +apt-get install -y --no-install-recommends docker-ce + +# Cleanup +apt-get purge -y \ + dirmngr \ + gnupg \ + jq \ + lsb-release +apt-get autoremove --purge -y +rm -rf /var/lib/apt/lists/*