Initial version

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-08-20 13:10:55 +02:00
commit 695fe3a1bf
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 45 additions and 0 deletions

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM luzifer/archlinux
LABEL maintainer Knut Ahlers <knut@ahlers.me>
COPY build.sh /usr/local/bin/
RUN set -ex \
&& /usr/local/bin/build.sh
ENTRYPOINT ["/usr/local/bin/inner-runner"]
CMD ["--"]

33
build.sh Executable file
View file

@ -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[@]}"