diff --git a/s390x-native.Dockerfile b/s390x-native.Dockerfile index 639b315..14a6177 100644 --- a/s390x-native.Dockerfile +++ b/s390x-native.Dockerfile @@ -5,6 +5,14 @@ FROM s390x/ubuntu:${UBUNTU_VERSION} # Redefining UBUNTU_VERSION without a value inherits the global default ARG UBUNTU_VERSION +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get -y install \ + git \ + jq \ + sudo \ + tree \ + wget + RUN apt-get update \ && apt-get install -y cmake flex bison build-essential libssl-dev ncurses-dev xz-utils bc rsync libguestfs-tools qemu-kvm qemu-utils linux-image-generic zstd binutils-dev elfutils libcap-dev libelf-dev libdw-dev python3-docutils \ && apt-get install -y g++ libelf-dev \ @@ -40,29 +48,31 @@ RUN cd /tmp && \ sed -i'' -e /version/s/6......\"$/${SDK}.0.100\"/ src/global.json && \ git apply /tmp/runner.patch -RUN cd /tmp/runner/src && \ - ./dev.sh layout && \ - ./dev.sh package && \ - ./dev.sh test && \ - rm -rf /root/.dotnet /root/.nuget - - -# amd64 Github Actions Runner. +# Create Github Actions Runner user. ARG HOMEDIR=/actions-runner -# Copy scripts from myoung34/docker-github-actions-runner -RUN curl -L https://raw.githubusercontent.com/myoung34/docker-github-actions-runner/${VERSION}/entrypoint.sh -o /entrypoint.sh && chmod 755 /entrypoint.sh -RUN curl -L https://raw.githubusercontent.com/myoung34/docker-github-actions-runner/${VERSION}/token.sh -o /token.sh && chmod 755 /token.sh - +WORKDIR ${HOMEDIR} RUN useradd -d ${HOMEDIR} -m runner RUN echo "runner ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers RUN echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >>/etc/sudoers # Make sure kvm group exists. This is a no-op when it does. RUN addgroup --system kvm RUN usermod -a -G kvm runner + +RUN cd /tmp/runner/src && \ + ./dev.sh layout && \ + ./dev.sh package && \ + ./dev.sh test && \ + rm -rf /root/.dotnet /root/.nuget + +# install actions-runner package as user `runner` USER runner ENV USER=runner -WORKDIR ${HOMEDIR} +RUN tar -xz /tmp/runner/_layout/actions-runner-linux-s390x-${VERSION}.tar.gz USER root +# Copy scripts from myoung34/docker-github-actions-runner +RUN curl -L https://raw.githubusercontent.com/myoung34/docker-github-actions-runner/${VERSION}/entrypoint.sh -o /entrypoint.sh && chmod 755 /entrypoint.sh +RUN curl -L https://raw.githubusercontent.com/myoung34/docker-github-actions-runner/${VERSION}/token.sh -o /token.sh && chmod 755 /token.sh + ENTRYPOINT ["/entrypoint.sh"] CMD ["./bin/Runner.Listener", "run", "--startuptype", "service"]