Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a033875662 | ||
|
|
77bb89fd23 | ||
|
|
97b9681fdf | ||
|
|
b024ba2957 | ||
|
|
f8953c67a1 | ||
|
|
20853b4e27 | ||
|
|
983dd6593c | ||
|
|
46f65587e3 | ||
|
|
657f9b882c | ||
|
|
2f3b19dbcb | ||
|
|
f7405e57af | ||
|
|
6ccebdcc6d | ||
|
|
95be9f08b5 | ||
|
|
7a38b6d314 | ||
|
|
f0a62e35dc | ||
|
|
efdec6ab8c | ||
|
|
7d944a9917 | ||
|
|
000da19866 | ||
|
|
c72e53dd91 | ||
|
|
25ddc313e8 | ||
|
|
f48b16015a | ||
|
|
d40ef464fc | ||
|
|
016a28caf7 | ||
|
|
add05adf31 | ||
|
|
45c25ba5de | ||
|
|
62b1fd5e32 | ||
|
|
586a23ad2c | ||
|
|
f99b59b25f | ||
|
|
687df76fdd | ||
|
|
147520a900 | ||
|
|
cb15320c41 |
@@ -1,107 +1,68 @@
|
||||
name: Publish Docker
|
||||
name: GitHub Actions Runner in Docker - Latest
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
paths-ignore:
|
||||
- README.md
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
ubuntu_latest_deploy_x86:
|
||||
ubuntu_latest_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu -t myoung34/github-runner:latest .
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:latest
|
||||
ubuntu_bionic_deploy_x86:
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile -t ${ORG}/github-runner:latest --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
ubuntu_bionic_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-bionic -t myoung34/github-runner:ubuntu-bionic .
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
run: cp Dockerfile Dockerfile.ubuntu-bionic; sed -i.bak 's/FROM.*/FROM ubuntu:bionic/' Dockerfile.ubuntu-bionic
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:ubuntu-bionic
|
||||
ubuntu_xenial_deploy_x86:
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.ubuntu-bionic -t ${ORG}/github-runner:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
ubuntu_xenial_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-xenial -t myoung34/github-runner:ubuntu-xenial .
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
run: cp Dockerfile Dockerfile.ubuntu-xenial; sed -i.bak 's/FROM.*/FROM ubuntu:xenial/' Dockerfile.ubuntu-xenial
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:ubuntu-xenial
|
||||
ubuntu_latest_deploy_arm:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-arm -t myoung34/github-runner:latest-arm .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:latest-arm
|
||||
ubuntu_bionic_deploy_arm:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-bionic-arm -t myoung34/github-runner:ubuntu-bionic-arm .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:ubuntu-bionic-arm
|
||||
ubuntu_xenial_deploy_arm:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-xenial-arm -t myoung34/github-runner:ubuntu-xenial-arm .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:ubuntu-xenial-arm
|
||||
ubuntu_latest_deploy_arm64:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-arm -t myoung34/github-runner:latest-arm64 --build-arg DOCKER_ARCH=arm64 --build-arg ACTIONS_ARCH=arm64 .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:latest-arm64
|
||||
ubuntu_bionic_deploy_arm64:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-bionic-arm -t myoung34/github-runner:ubuntu-bionic-arm64 --build-arg DOCKER_ARCH=arm64 --build-arg ACTIONS_ARCH=arm64 .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:ubuntu-bionic-arm64
|
||||
ubuntu_xenial_deploy_arm64:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-xenial-arm -t myoung34/github-runner:ubuntu-xenial-arm64 --build-arg DOCKER_ARCH=arm64 --build-arg ACTIONS_ARCH=arm64 .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:ubuntu-xenial-arm64
|
||||
run: docker buildx build -f Dockerfile.ubuntu-xenial -t ${ORG}/github-runner:ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
|
||||
@@ -1,124 +1,73 @@
|
||||
name: Publish Docker
|
||||
name: GitHub Actions Runner in Docker - Release
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- README.md
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
ubuntu_tag_deploy_x86:
|
||||
ubuntu_latest_tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu -t myoung34/github-runner:${TAG} .
|
||||
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}
|
||||
ubuntu_bionic_deploy_x86:
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile -t ${ORG}/github-runner:${TAG} --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
ubuntu_bionic_tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-bionic -t myoung34/github-runner:${TAG}-ubuntu-bionic .
|
||||
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
run: cp Dockerfile Dockerfile.ubuntu-bionic; sed -i.bak 's/FROM.*/FROM ubuntu:bionic/' Dockerfile.ubuntu-bionic
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}-ubuntu-bionic
|
||||
ubuntu_xenial_deploy_x86:
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.ubuntu-bionic -t ${ORG}/github-runner:${TAG}-ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
ubuntu_xenial_tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-xenial -t myoung34/github-runner:${TAG}-ubuntu-xenial .
|
||||
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
run: cp Dockerfile Dockerfile.ubuntu-xenial; sed -i.bak 's/FROM.*/FROM ubuntu:xenial/' Dockerfile.ubuntu-xenial
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}-ubuntu-xenial
|
||||
ubuntu_tag_deploy_arm:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-arm -t myoung34/github-runner:${TAG}-arm .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}-arm
|
||||
ubuntu_bionic_deploy_arm:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-bionic-arm -t myoung34/github-runner:${TAG}-ubuntu-bionic-arm .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}-ubuntu-bionic-arm
|
||||
ubuntu_xenial_deploy_arm:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-xenial-arm -t myoung34/github-runner:${TAG}-ubuntu-xenial-arm .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}-ubuntu-xenial-arm
|
||||
ubuntu_tag_deploy_arm64:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-arm -t myoung34/github-runner:${TAG}-arm64 --build-arg DOCKER_ARCH=arm64 --build-arg ACTIONS_ARCH=arm64 .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}-arm64
|
||||
ubuntu_bionic_deploy_arm64:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-bionic-arm -t myoung34/github-runner:${TAG}-ubuntu-bionic-arm64 --build-arg DOCKER_ARCH=arm64 --build-arg ACTIONS_ARCH=arm64 .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}-ubuntu-bionic-arm64
|
||||
ubuntu_xenial_deploy_arm64:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
|
||||
- name: Build
|
||||
run: docker build -f Dockerfile.ubuntu-xenial-arm -t myoung34/github-runner:${TAG}-ubuntu-xenial-arm64 --build-arg DOCKER_ARCH=arm64 --build-arg ACTIONS_ARCH=arm64 .
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Push to hub registry
|
||||
run: docker push myoung34/github-runner:${TAG}-ubuntu-xenial-arm64
|
||||
run: docker buildx build -f Dockerfile.ubuntu-xenial -t ${ORG}/github-runner:${TAG}-ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
*.bak
|
||||
@@ -1,11 +1,9 @@
|
||||
FROM ubuntu:xenial
|
||||
FROM ubuntu:rolling
|
||||
LABEL maintainer="3vilpenguin@gmail.com"
|
||||
|
||||
ARG DOCKER_ARCH=armhf
|
||||
ARG ACTIONS_ARCH=arm
|
||||
|
||||
ARG GH_RUNNER_VERSION="2.163.1"
|
||||
ARG GIT_VERSION="2.23.0"
|
||||
ARG GH_RUNNER_VERSION="2.168.0"
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
# hadolint ignore=DL3003
|
||||
@@ -21,12 +19,12 @@ RUN apt-get update && \
|
||||
build-essential \
|
||||
zlib1g-dev \
|
||||
gettext \
|
||||
liblttng-ust-ctl2 \
|
||||
liblttng-ust0 \
|
||||
liburcu4 \
|
||||
libcurl4-openssl-dev \
|
||||
inetutils-ping \
|
||||
jq \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& c_rehash \
|
||||
&& cd /tmp \
|
||||
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
|
||||
&& tar zxf git.tgz \
|
||||
@@ -38,18 +36,21 @@ RUN apt-get update && \
|
||||
&& rm -rf /tmp/git.tgz /tmp/git-${GIT_VERSION}
|
||||
|
||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& add-apt-repository "deb [arch=${DOCKER_ARCH}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
||||
&& [[ $(lsb_release -cs) == "eoan" ]] && ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu disco stable" ) || ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" )\
|
||||
&& apt-get update \
|
||||
&& apt-get install -y docker.io --no-install-recommends \
|
||||
&& apt-get install -y docker-ce docker-ce-cli containerd.io --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -sL "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
|
||||
&& chmod +x /usr/local/bin/docker-compose
|
||||
|
||||
WORKDIR /actions-runner
|
||||
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& tar -zxf actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& rm -f actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& mkdir /_work
|
||||
COPY install_actions.sh /actions-runner
|
||||
|
||||
RUN chmod +x /actions-runner/install_actions.sh \
|
||||
&& /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} ${TARGETPLATFORM} \
|
||||
&& rm /actions-runner/install_actions.sh
|
||||
|
||||
WORKDIR /_work
|
||||
COPY entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -1,36 +0,0 @@
|
||||
FROM ubuntu:bionic
|
||||
LABEL maintainer="3vilpenguin@gmail.com"
|
||||
|
||||
ARG GH_RUNNER_VERSION="2.163.1"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
tar \
|
||||
git \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
sudo \
|
||||
gnupg-agent \
|
||||
software-properties-common \
|
||||
inetutils-ping \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y docker-ce --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /actions-runner
|
||||
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& tar -zxf actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& rm -f actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& ./bin/installdependencies.sh \
|
||||
&& mkdir /_work
|
||||
|
||||
WORKDIR /_work
|
||||
COPY entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -1,55 +0,0 @@
|
||||
FROM ubuntu:bionic
|
||||
LABEL maintainer="3vilpenguin@gmail.com"
|
||||
|
||||
ARG DOCKER_ARCH=armhf
|
||||
ARG ACTIONS_ARCH=arm
|
||||
|
||||
ARG GH_RUNNER_VERSION="2.163.1"
|
||||
ARG GIT_VERSION="2.23.0"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
# hadolint ignore=DL3003
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
tar \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
sudo \
|
||||
gnupg-agent \
|
||||
software-properties-common \
|
||||
build-essential \
|
||||
zlib1g-dev \
|
||||
gettext \
|
||||
liblttng-ust-ctl4 \
|
||||
liblttng-ust0 \
|
||||
liburcu6 \
|
||||
libcurl4-openssl-dev \
|
||||
inetutils-ping \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& cd /tmp \
|
||||
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
|
||||
&& tar zxf git.tgz \
|
||||
&& cd git-${GIT_VERSION} \
|
||||
&& ./configure --prefix=/usr \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& cd / \
|
||||
&& rm -rf /tmp/git.tgz /tmp/git-${GIT_VERSION}
|
||||
|
||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& add-apt-repository "deb [arch=${DOCKER_ARCH}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y docker.io --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /actions-runner
|
||||
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& tar -zxf actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& rm -f actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& mkdir /_work
|
||||
|
||||
WORKDIR /_work
|
||||
COPY entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -1,36 +0,0 @@
|
||||
FROM ubuntu:bionic
|
||||
LABEL maintainer="3vilpenguin@gmail.com"
|
||||
|
||||
ARG GH_RUNNER_VERSION="2.163.1"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
tar \
|
||||
git \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
sudo \
|
||||
gnupg-agent \
|
||||
software-properties-common \
|
||||
inetutils-ping \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y docker-ce --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /actions-runner
|
||||
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& tar -zxf actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& rm -f actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& ./bin/installdependencies.sh \
|
||||
&& mkdir /_work
|
||||
|
||||
WORKDIR /_work
|
||||
COPY entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -1,55 +0,0 @@
|
||||
FROM ubuntu:bionic
|
||||
LABEL maintainer="3vilpenguin@gmail.com"
|
||||
|
||||
ARG DOCKER_ARCH=armhf
|
||||
ARG ACTIONS_ARCH=arm
|
||||
|
||||
ARG GH_RUNNER_VERSION="2.163.1"
|
||||
ARG GIT_VERSION="2.23.0"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
# hadolint ignore=DL3003
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
tar \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
sudo \
|
||||
gnupg-agent \
|
||||
software-properties-common \
|
||||
build-essential \
|
||||
zlib1g-dev \
|
||||
gettext \
|
||||
liblttng-ust-ctl4 \
|
||||
liblttng-ust0 \
|
||||
liburcu6 \
|
||||
libcurl4-openssl-dev \
|
||||
inetutils-ping \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& cd /tmp \
|
||||
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
|
||||
&& tar zxf git.tgz \
|
||||
&& cd git-${GIT_VERSION} \
|
||||
&& ./configure --prefix=/usr \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& cd / \
|
||||
&& rm -rf /tmp/git.tgz /tmp/git-${GIT_VERSION}
|
||||
|
||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& add-apt-repository "deb [arch=${DOCKER_ARCH}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y docker.io --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /actions-runner
|
||||
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& tar -zxf actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& rm -f actions-runner-linux-${ACTIONS_ARCH}-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& mkdir /_work
|
||||
|
||||
WORKDIR /_work
|
||||
COPY entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -1,36 +0,0 @@
|
||||
FROM ubuntu:xenial
|
||||
LABEL maintainer="3vilpenguin@gmail.com"
|
||||
|
||||
ARG GH_RUNNER_VERSION="2.163.1"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
tar \
|
||||
git \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
sudo \
|
||||
gnupg-agent \
|
||||
software-properties-common \
|
||||
inetutils-ping \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y docker-ce --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /actions-runner
|
||||
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& tar -zxf actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& rm -f actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
|
||||
&& ./bin/installdependencies.sh \
|
||||
&& mkdir /_work
|
||||
|
||||
WORKDIR /_work
|
||||
COPY entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Marcus Young
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,36 +1,60 @@
|
||||
Docker Github Actions Runner
|
||||
============================
|
||||
|
||||
This will run the [new self-hosted github actions runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/hosting-your-own-runners) with docker-in-docker
|
||||
This will run the [new self-hosted github actions runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/hosting-your-own-runners).
|
||||
|
||||
This has been tested and verified on:
|
||||
|
||||
* x86_64
|
||||
* armhf
|
||||
* armv7
|
||||
* arm64
|
||||
|
||||
**NOTE: Only one runner can use the same RUNNER_WORKDIR if it is shared storage.**
|
||||
|
||||
## Examples ##
|
||||
|
||||
Manual:
|
||||
### Note ###
|
||||
|
||||
### X86_64 ###
|
||||
If you're using a RHEL based OS with SELinux, add `--security-opt=label=disable` to prevent [permission denied](https://github.com/myoung34/docker-github-actions-runner/issues/9)
|
||||
|
||||
### Manual ###
|
||||
|
||||
```
|
||||
docker run -it \
|
||||
-e REPO_URL="https://github.com/myoung34/LEDSpicer" \
|
||||
docker run -d --restart always --name github-runner \
|
||||
-e REPO_URL="https://github.com/myoung34/repo" \
|
||||
-e RUNNER_NAME="foo-runner" \
|
||||
-e RUNNER_TOKEN="footoken" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/github-runner-repo:/tmp/github-runner-repo \
|
||||
myoung34/github-runner:latest
|
||||
```
|
||||
|
||||
### ARMHF (raspberry pi) ###
|
||||
Or shell wrapper:
|
||||
|
||||
```
|
||||
docker run -it \
|
||||
-e REPO_URL="https://github.com/myoung34/LEDSpicer" \
|
||||
-e RUNNER_TOKEN="footoken" \
|
||||
myoung34/github-runner:latest-arm
|
||||
function github-runner {
|
||||
name=github-runner-${1//\//-}
|
||||
org=$(dirname $1)
|
||||
repo=$(basename $1)
|
||||
tag=${3:-latest}
|
||||
docker rm -f $name
|
||||
docker run -d --restart=always \
|
||||
-e REPO_URL="https://github.com/${org}/${repo}" \
|
||||
-e RUNNER_TOKEN="$2" \
|
||||
-e RUNNER_NAME="linux-${repo}" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/github-runner-${repo}:/tmp/github-runner-${repo} \
|
||||
--name $name ${org}/github-runner:${tag}
|
||||
}
|
||||
|
||||
github-runner your-account/your-repo AARGHTHISISYOURGHACTIONSTOKEN
|
||||
github-runner your-account/some-other-repo ARGHANOTHERGITHUBACTIONSTOKEN ubuntu-xenial
|
||||
```
|
||||
|
||||
Nomad:
|
||||
### Nomad ###
|
||||
|
||||
```
|
||||
job "github_runner" {
|
||||
@@ -41,22 +65,70 @@ job "github_runner" {
|
||||
driver = "docker"
|
||||
|
||||
env {
|
||||
REPO_URL = "https://github.com/myoung34/LEDSpicer"
|
||||
RUNNER_TOKEN = "footoken"
|
||||
REPO_URL = "https://github.com/your-account/your-repo"
|
||||
RUNNER_TOKEN = "footoken"
|
||||
RUNNER_WORKDIR = "/tmp/github-runner"
|
||||
}
|
||||
|
||||
config {
|
||||
privileged = true
|
||||
image = "myoung34/github-runner:latest"
|
||||
volumes = [
|
||||
"/var/run/docker.sock:/var/run/docker.sock"
|
||||
"/var/run/docker.sock:/var/run/docker.sock",
|
||||
"/tmp/github-runner-your-repo:/tmp/github-runner-your-repo",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Usage ##
|
||||
### Kubernetes ###
|
||||
|
||||
```
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: actions-runner
|
||||
namespace: runners
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: actions-runner
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: actions-runner
|
||||
spec:
|
||||
volumes:
|
||||
- name: dockersock
|
||||
hostPath:
|
||||
path: /var/run/docker.sock
|
||||
- name: workdir
|
||||
hostPath:
|
||||
path: /tmp/github-runner-your-repo
|
||||
containers:
|
||||
- name: runner
|
||||
image: myoung34/github-runner:latest
|
||||
env:
|
||||
- name: RUNNER_TOKEN
|
||||
value: footoken
|
||||
- name: REPO_URL
|
||||
value: https://github.com/your-account/your-repo
|
||||
- name: RUNNER_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: RUNNER_WORKDIR
|
||||
value: /tmp/github-runner-your-repo
|
||||
volumeMounts:
|
||||
- name: dockersock
|
||||
mountPath: /var/run/docker.sock
|
||||
- name: workdir
|
||||
mountPath: /tmp/github-runner-your-repo
|
||||
```
|
||||
|
||||
## Usage From GH Actions Workflow ##
|
||||
|
||||
```
|
||||
name: Package
|
||||
@@ -73,3 +145,18 @@ jobs:
|
||||
- name: build packages
|
||||
run: make all
|
||||
```
|
||||
|
||||
## Automatically Acquiring a Runner Token ##
|
||||
|
||||
A runner token can be automatically acquired at runtime if `ACCESS_TOKEN` (a GitHub personal access token) is a supplied. This uses the [GitHub Actions API](https://developer.github.com/v3/actions/self_hosted_runners/#create-a-registration-token). e.g.:
|
||||
|
||||
```
|
||||
docker run -d --restart always --name github-runner \
|
||||
-e ACCESS_TOKEN="footoken" \
|
||||
-e REPO_URL="https://github.com/myoung34/repo" \
|
||||
-e RUNNER_NAME="foo-runner" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
|
||||
myoung34/github-runner:latest
|
||||
```
|
||||
|
||||
+25
-3
@@ -1,7 +1,29 @@
|
||||
#!/bin/bash
|
||||
export AGENT_ALLOW_RUNASROOT=1
|
||||
|
||||
export RUNNER_ALLOW_RUNASROOT=1
|
||||
export PATH=$PATH:/actions-runner
|
||||
|
||||
_RUNNER_NAME=${RUNNER_NAME:-default}
|
||||
_RUNNER_WORKDIR=${RUNNER_WORKDIR:-/_work}
|
||||
config.sh --url "${REPO_URL}" --token "${RUNNER_TOKEN}" --name "${_RUNNER_NAME}" --work "${_RUNNER_WORKDIR}"
|
||||
exec run.sh
|
||||
|
||||
if [[ -n "${ACCESS_TOKEN}" ]]; then
|
||||
URI=https://api.github.com
|
||||
API_VERSION=v3
|
||||
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
|
||||
AUTH_HEADER="Authorization: token ${ACCESS_TOKEN}"
|
||||
|
||||
_PROTO="$(echo "${REPO_URL}" | grep :// | sed -e's,^\(.*://\).*,\1,g')"
|
||||
_URL="$(echo "${REPO_URL/${_PROTO}/}")"
|
||||
_PATH="$(echo "${_URL}" | grep / | cut -d/ -f2-)"
|
||||
_ACCOUNT="$(echo "${_PATH}" | cut -d/ -f1)"
|
||||
_REPO="$(echo "${_PATH}" | cut -d/ -f2)"
|
||||
|
||||
RUNNER_TOKEN="$(curl -XPOST -fsSL \
|
||||
-H "${AUTH_HEADER}" \
|
||||
-H "${API_HEADER}" \
|
||||
"${URI}/repos/${_ACCOUNT}/${_REPO}/actions/runners/registration-token" \
|
||||
| jq -r '.token')"
|
||||
fi
|
||||
|
||||
./config.sh --url "${REPO_URL}" --token "${RUNNER_TOKEN}" --name "${_RUNNER_NAME}" --work "${_RUNNER_WORKDIR}"
|
||||
./run.sh
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash -x
|
||||
GH_RUNNER_VERSION=$1
|
||||
TARGETPLATFORM=$2
|
||||
|
||||
export TARGET_ARCH="x64"
|
||||
if [[ $TARGETPLATFORM == "linux/arm/v7" ]]; then
|
||||
export TARGET_ARCH="arm"
|
||||
elif [[ $TARGETPLATFORM == "linux/arm64" ]]; then
|
||||
export TARGET_ARCH="arm64"
|
||||
fi
|
||||
curl -L "https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-${TARGET_ARCH}-${GH_RUNNER_VERSION}.tar.gz" > actions.tar.gz
|
||||
tar -zxf actions.tar.gz
|
||||
rm -f actions.tar.gz
|
||||
./bin/installdependencies.sh
|
||||
mkdir /_work
|
||||
Reference in New Issue
Block a user