Compare commits

...
88 Commits
Author SHA1 Message Date
Marcus Young bdc848c9a0 Bump to version 2.273.0 2020-08-19 09:53:13 -05:00
myoung34andGitHub 26ed21bcfc Merge pull request #44 from divlv/master
Notes regarding PAT scopes and privileges.
2020-08-06 13:52:32 -05:00
Dmitrijs ZaharovsandGitHub 5357aa869c Notes regarding PAT scopes and privileges. 2020-08-06 21:44:12 +03:00
Marcus Young d68d9f6fc8 Bump to version 2.272.0 2020-07-29 15:38:28 -04:00
myoung34andGitHub abd5a962b5 Create SECURITY.md 2020-07-28 10:55:08 -05:00
Marcus Young 7ccb4ed034 Update readme 2020-07-10 10:05:59 -05:00
myoung34andGitHub 531dbeab92 Merge pull request #40 from myoung34/actions_add
Add all workflows back
2020-07-06 07:51:16 -05:00
Marcus Young 814b400daf Add all workflows back 2020-07-06 07:50:48 -05:00
myoung34andGitHub c569803c05 Merge pull request #39 from myoung34/actions_remove
Trying fix for github actions cron mod
2020-07-06 07:49:44 -05:00
Marcus Young 57fd528ae9 Trying fix for github actions cron mod 2020-07-06 07:49:06 -05:00
Marcus Young fad3705687 Add scheduled builders 2020-07-05 20:18:54 -05:00
Marcus Young dbf917bdc9 Bump to version 2.267.1 2020-06-30 21:26:33 -05:00
Marcus Young 15bc90d41e Dummy commit to force latest rebuild 2020-06-29 15:27:35 -05:00
myoung34andGitHub 5f16e6caf2 Merge pull request #37 from Kreelio/feat/add-unzip
feat: add unzip to docker image
2020-06-29 13:29:23 -05:00
myoung34andGitHub c0b9c0300e Merge pull request #36 from aslafy-z/patch-1
fix(docs): quote boolean in docker-compose example
2020-06-29 13:29:00 -05:00
ZadkielandGitHub 4dc6700829 feat: add unzip to docker image 2020-06-29 20:19:31 +02:00
ZadkielandGitHub 3e492d23bd fix(docs): quote boolean in docker-compose example 2020-06-29 20:02:28 +02:00
Marcus Young d2f686e857 Bump to version 2.267.0 2020-06-23 13:42:18 -05:00
Marcus Young 18198af872 Fix docs a bit 2020-06-15 07:20:45 -05:00
myoung34andGitHub 03bd34f460 Merge pull request #31 from myoung34/develop
Optimize base
2020-06-12 09:26:06 -05:00
Marcus Young 210dcf0f84 Optimize base 2020-06-12 08:43:34 -05:00
Kevin JonesandGitHub fd49993401 Added RUNNER_WORKDIR mounting readme note
Fix for https://github.com/myoung34/docker-github-actions-runner/issues/27#issue-630231157
2020-06-03 12:22:58 -07:00
Marcus Young 1e12527d1b Fix deprecation warning for buildx-version 2020-05-31 15:17:45 -05:00
Marcus Young 7648aa4205 Add basic support for SIGTERM handling 2020-05-27 06:46:57 -05:00
Marcus Young 5c2992ba3f Fix _PROTO when repo_url not given 2020-05-27 06:13:53 -05:00
Marcus Young f0db7fd111 Actions hates me 2020-05-26 17:53:36 -05:00
Marcus Young 01aa45246c Add awscli into base 2020-05-26 17:52:36 -05:00
Marcus Young 3d44159889 Unset ACCESS_TOKEN|RUNNER_TOKEN after configure 2020-05-23 06:58:05 -05:00
Marcus Young 258480828a Add random default name with prefix 2020-05-21 16:26:51 -05:00
Marcus Young 48ee0c82d4 Bump to version 2.263.0 2020-05-21 15:43:07 -05:00
Marcus Young a3b5dc873d Add automatic release creation 2020-05-13 13:55:09 -05:00
myoung34andGitHub 632d9e59ad bump to 2.262.1 2020-05-12 15:32:17 -05:00
Marcus Young 3ef0c00503 Remove unneeded curl echo in entrypoint 2020-05-11 14:48:22 -05:00
Marcus Young 47144a0075 Bump to 2.262.0 2020-05-11 14:46:02 -05:00
Marcus Young 5080efc02c Test runsvc vs run.sh 2020-05-11 14:40:44 -05:00
myoung34andGitHub de737c2bff Merge pull request #20 from pirate/patch-2
Add docker-compose example setup
2020-04-28 06:49:34 -05:00
Nick SweetingandGitHub d3302f81d6 Add docker-compose example setup 2020-04-28 04:57:15 -04:00
myoung34andGitHub 94765718f8 Merge pull request #18 from EduMelo/master
Fixed REPO_URL setting without ACCESS_TOKEN
2020-04-27 06:18:06 -05:00
EduMelo 35e638434c Remove redundant line 2020-04-27 01:47:58 +00:00
EduMelo d0dfd51b8f Fixed REPO_URL setting without ACCESS_TOKEN 2020-04-26 23:02:35 +00:00
myoung34andGitHub 6bb8d76ea2 Merge pull request #17 from mvcaaa/patch-1
Update entrypoint.sh
2020-04-25 15:38:49 -05:00
Andrey AstashovandGitHub d18d41c831 Update entrypoint.sh
- Better formatting
- Added `--unattended` flag
2020-04-25 22:44:19 +03:00
myoung34andGitHub 449d82760a Update README.md 2020-04-25 08:02:00 -05:00
myoung34andGitHub f47c515abd Create FUNDING.yml 2020-04-25 08:00:07 -05:00
Marcus Young 5893376f9d Fix single quote in stage 2020-04-25 07:52:51 -05:00
Marcus Young a5497419bc Let ORG be inferred in base, fix escaping 2020-04-25 07:28:06 -05:00
Marcus Young a1590538ff update maintainer email in dockerfile 2020-04-25 07:23:48 -05:00
Marcus Young b6d79c9dfb Set base latest to eoan 2020-04-25 05:57:45 -05:00
myoung34andGitHub a794698340 Merge pull request #16 from pirate/patch-1
Fix inifinite loop on startup if runner was stopped and restarted
2020-04-25 05:34:16 -05:00
Marcus Young afec008f29 Fix old base to previously working non-base steps 2020-04-25 05:29:39 -05:00
Nick SweetingandGitHub c7e53fe739 fix tzdata requesting user input on build 2020-04-25 03:30:32 -04:00
Nick SweetingandGitHub 4ddf3ecf7b Fix inifinite loop on startup if runner was stopped and restarted 2020-04-25 03:15:07 -04:00
Marcus Young 499ec5be2b Fix maintainer to match github email 2020-04-24 22:10:32 -05:00
Marcus Young bf3b69b42c Fix cp in base xenial 2020-04-24 22:08:49 -05:00
Marcus Young 3d71db0489 Bump git to 2.26.2 to test pipelines 2020-04-24 22:04:39 -05:00
Marcus Young d94e9ac8ed Fix bad cp in new base 2020-04-24 21:23:43 -05:00
Marcus Young 4ad9ab74d2 Remove uneeded args from base 2020-04-24 21:21:18 -05:00
Marcus Young e1c417920c [wip] Split Docker container into 2 parts to make builds much faster 2020-04-24 21:18:52 -05:00
Marcus Young 9e91608d19 Add support for org runners with ORG_RUNNER=true,ORG_NAME=wut,LABELS=a,b env vars 2020-04-24 18:39:31 -05:00
Marcus Young 6b6ee9e9f3 Bump to 2.169.1 2020-04-15 14:21:27 -05:00
Marcus Young 209276897a Bump to 2.169.0 2020-04-08 12:11:31 -05:00
myoung34andGitHub ca85306837 Merge pull request #13 from patst/master
Update examples to match WORKDIR to volume mounts
2020-04-07 15:12:46 -05:00
patstandGitHub 040ac6cfca Fix volume mount to match WORKDIR 2020-04-07 21:35:05 +02:00
patstandGitHub 176dcf0d33 Fix RUNNER_WORKDIR path in README 2020-04-07 21:33:38 +02:00
Marcus Young a033875662 Bump to 2.168.0 2020-04-03 12:43:29 -05:00
Marcus Young 77bb89fd23 Add MIT license 2020-03-31 14:28:50 -05:00
myoung34andGitHub 97b9681fdf Merge pull request #10 from terradatum/master
Only one runner can use the same RUNNER_WORKDIR if it is shared storage.
2020-03-13 20:03:52 -05:00
G. Richard Bellamy b024ba2957 Only one runner can use the same RUNNER_WORKDIR if it is shared storage.
The "Set up job" step at the beginning of a workflow will delete the `_actions` directory. Therefore,
you cannot have more than one container running on the same Docker host sharing storage via a volume
mount (e.g. `/tmp/github-runner`) used by `RUNNER_WORKDIR`.

https://github.community/t5/GitHub-Actions/Does-self-hosted-runner-clear-all-previous-actions-during-quot/m-p/50061
2020-03-13 14:14:36 -07:00
myoung34andGitHub f8953c67a1 Update README.md 2020-03-08 11:10:09 -05:00
myoung34andGitHub 20853b4e27 Update README.md 2020-03-08 11:09:18 -05:00
myoung34andGitHub 983dd6593c Merge pull request #8 from stevenpall/master
Get Runner Token Automatically
2020-02-26 23:02:41 -06:00
Steven Pall 46f65587e3 Get RUNNER_TOKEN Automatically
- Add the ability to specify a personal access token to use for calling the new Actions API for a runner token
- Add `jq` and `docker-compose` to the `Dockerfile`
- Update `README.md`
2020-02-26 16:39:31 -08:00
myoung34andGitHub 657f9b882c Update Dockerfile
Bump GH actions to 2.165.2
2020-02-12 13:52:25 -06:00
Marcus Young 2f3b19dbcb Update README from #7 2020-02-12 10:12:38 -06:00
myoung34andGitHub f7405e57af Merge pull request #6 from terradatum/master
Workflows target docker hub by Org/Account.
2020-02-11 14:26:44 -06:00
G. Richard Bellamy 6ccebdcc6d Make workflows target docker hub by organization/account.
IT-4071 #comment Make workflows target docker hub by organization/account.
2020-02-11 12:15:35 -08:00
G. Richard Bellamy 95be9f08b5 Make workflows target docker hub by organization/account.
IT-4071 #comment Install maven and npm - should go through the list of default utilities and tools installed into `ubuntu-latest` for parity with GitHub runners. Many actions will rely on and expect them.
IT-4071 #comment Because of https://bugs.launchpad.net/ubuntu/+source/nodejs/+bug/1794589, both libcurl4-openssl-dev and npm cannot be installed in bionic using the package. There are two options: 1) Use libcurl4-gnutls-dev rather than libcurl4-openssl-dev, 2) Install npm using the installation script from github. I choose option #2.
IT-4071 #comment Make workflows target docker hub by organization/account.
2020-02-10 13:48:32 -08:00
myoung34andGitHub 7a38b6d314 Update README.md 2020-02-06 07:13:17 -06:00
myoung34andGitHub f0a62e35dc Update README.md 2020-02-06 07:12:46 -06:00
myoung34andGitHub efdec6ab8c Merge pull request #5 from Pentusha/master
Multiarch builds fixed for #4
2020-02-05 13:42:42 -06:00
Ivan Larin 7d944a9917 Multiarch builds fixed for #4 2020-02-05 19:38:45 +03:00
myoung34andGitHub 000da19866 Bump to 2.165.1 2020-01-30 21:31:09 -06:00
Marcus Young c72e53dd91 Remove unneeded and fragile packages 2020-01-28 07:28:39 -06:00
Marcus Young 25ddc313e8 Simplify docker builds 2020-01-27 22:17:15 -06:00
myoung34andGitHub f48b16015a Merge pull request #3 from myoung34/2.165.0
Update to 2.165.0
2020-01-27 21:50:48 -06:00
myoung34andGitHub d40ef464fc Update Dockerfile.ubuntu-xenial 2020-01-27 21:49:21 -06:00
myoung34andGitHub 016a28caf7 Update Dockerfile.ubuntu-bionic 2020-01-27 21:48:38 -06:00
myoung34andGitHub add05adf31 Update Dockerfile.ubuntu 2020-01-27 21:47:32 -06:00
15 changed files with 480 additions and 149 deletions
+3
View File
@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: myoung34
+71
View File
@@ -0,0 +1,71 @@
name: GitHub Actions Runner in Docker - Base
on:
push:
paths:
- Dockerfile.base
branches:
- master
- develop
schedule:
- cron: '0 22 * * *'
jobs:
ubuntu_base_latest_deploy:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- 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:
buildx-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: Build
run: docker buildx build -f Dockerfile.base -t ${ORG}/github-runner-base:latest --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_base_bionic_deploy:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- 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:
buildx-version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.ubuntu-bionic; sed -i.bak 's/FROM.*/FROM ubuntu:bionic/' Dockerfile.base.ubuntu-bionic
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.base.ubuntu-bionic -t ${ORG}/github-runner-base:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_base_xenial_deploy:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- 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:
buildx-version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.ubuntu-xenial; sed -i.bak 's/FROM.*/FROM ubuntu:xenial/' Dockerfile.base.ubuntu-xenial
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.base.ubuntu-xenial -t ${ORG}/github-runner-base:ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
+23 -8
View File
@@ -1,9 +1,14 @@
name: Publish Docker
name: GitHub Actions Runner in Docker - Latest
on:
push:
branches:
paths-ignore:
- Dockerfile.base
- README.md
branches:
- master
- develop
schedule:
- cron: '59 23 * * *'
jobs:
ubuntu_latest_deploy:
@@ -11,46 +16,56 @@ jobs:
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- 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
buildx-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: Build
run: docker buildx build -f Dockerfile.ubuntu -t myoung34/github-runner:latest --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
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: 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
buildx-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 ${ORG}\/github-runner-base:ubuntu-bionic/" Dockerfile.ubuntu-bionic
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.ubuntu-bionic -t myoung34/github-runner:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
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: 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
buildx-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 ${ORG}\/github-runner-base:ubuntu-xenial/" Dockerfile.ubuntu-xenial
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.ubuntu-xenial -t myoung34/github-runner:ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/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 .
+42 -13
View File
@@ -1,61 +1,90 @@
name: Publish Docker
name: GitHub Actions Runner in Docker - Release
on:
push:
tags:
- '*'
jobs:
ubuntu_tag_deploy:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
ubuntu_latest_tag:
runs-on: ubuntu-latest
needs: create-release
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")"
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
buildx-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: Build
run: docker buildx build -f Dockerfile.ubuntu -t myoung34/github-runner:${TAG} --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_bionic_deploy:
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
needs: create-release
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")"
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
buildx-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 ${ORG}\/github-runner-base:ubuntu-bionic/" Dockerfile.ubuntu-bionic
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.ubuntu-bionic -t myoung34/github-runner:${TAG}-ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_xenial_deploy:
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
needs: create-release
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")"
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
buildx-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 ${ORG}\/github-runner-base:ubuntu-xenial/" Dockerfile.ubuntu-xenial
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.ubuntu-xenial -t myoung34/github-runner:${TAG}-ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/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 .
+1
View File
@@ -0,0 +1 @@
*.bak
+22
View File
@@ -0,0 +1,22 @@
# hadolint ignore=DL3007
FROM myoung34/github-runner-base:latest
LABEL maintainer="myoung34@my.apsu.edu"
ARG GH_RUNNER_VERSION="2.273.0"
ARG TARGETPLATFORM
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /actions-runner
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
COPY token.sh /
RUN chmod +x /token.sh
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+14 -27
View File
@@ -1,15 +1,17 @@
FROM ubuntu:rolling
LABEL maintainer="3vilpenguin@gmail.com"
FROM ubuntu:eoan
LABEL maintainer="myoung34@my.apsu.edu"
ARG GIT_VERSION="2.23.0"
ENV DEBIAN_FRONTEND=noninteractive
ARG GIT_VERSION="2.26.2"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
# hadolint ignore=DL3003
RUN apt-get update && \
apt-get install -y --no-install-recommends \
awscli \
curl \
tar \
unzip \
apt-transport-https \
ca-certificates \
sudo \
@@ -18,12 +20,10 @@ RUN apt-get update && \
build-essential \
zlib1g-dev \
gettext \
liblttng-ust-ctl4 \
liblttng-ust0 \
liburcu6 \
libcurl4-openssl-dev \
inetutils-ping \
&& rm -rf /var/lib/apt/lists/* \
jq \
&& c_rehash \
&& cd /tmp \
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
@@ -33,24 +33,11 @@ RUN apt-get update && \
&& 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 - \
&& [[ $(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" )\
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& [[ $(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-ce --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /actions-runner
COPY install_actions.sh /actions-runner
# Put version here to prevent cache invalidation
ENV GH_RUNNER_VERSION="2.164.0"
RUN chmod +x /actions-runner/install_actions.sh \
&& /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} \
&& rm /actions-runner/install_actions.sh
WORKDIR /_work
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
&& apt-get install -y docker-ce docker-ce-cli containerd.io --no-install-recommends \
&& 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 \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
-36
View File
@@ -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=$(dpkg --print-architecture)] 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"]
-36
View File
@@ -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=$(dpkg --print-architecture)] 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"]
+21
View File
@@ -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.
+186 -20
View File
@@ -1,40 +1,116 @@
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
[![Docker Pulls](https://img.shields.io/docker/pulls/myoung34/github-runner.svg)](https://hub.docker.com/r/myoung34/github-runner)
This has been tested and verified on:
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).
* x86_64
* armhf
* armv7
* arm64
## Docker Artifacts ##
| Container Base | Supported Architectures | Tag Regex | Docker Tags | Description |
| --- | --- | --- | --- | --- |
| ubuntu eoan | `x86_64`,`armv7`,`arm64` | `/\d\.\d{3}\.\d+/` | [latest](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=latest) | This is the latest build (Rebuilt nightly and on master merges). Tags without an OS name are included. |
| ubuntu bionic | `x86_64`,`armv7`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-bionic/` | [ubuntu-bionic](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-bionic) | This is the latest build from bionic (Rebuilt nightly and on master merges). Tags with `-ubuntu-bionic` are included and created on [upstream tags](https://github.com/actions/runner/tags). |
| ubuntu xenial | `x86_64`,`armv7`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-xenial/` | [ubuntu-xenial](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-xenial) | This is the latest build from xenial (Rebuilt nightly and on master merges). Tags with `-ubuntu-xenial` are included and created on [upstream tags](https://github.com/actions/runner/tags). |
These containers are built via Github actions that [copy the dockerfile](https://github.com/myoung34/docker-github-actions-runner/blob/master/.github/workflows/deploy.yml#L47), changing the `FROM` and building to provide simplicity.
## Environment Variables ##
| Environment Variable | Description |
| --- | --- |
| `RUNNER_NAME` | The name of the runner to use. Supercedes (overrides) `RUNNER_NAME_PREFIX` |
| `RUNNER_NAME_PREFIX` | A prefix for a randomly generated name (followed by a random 13 digit string). You must not also provide `RUNNER_NAME`. Defaults to `github-runner` |
| `ACCESS_TOKEN` | A [github PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) to use to generate `RUNNER_TOKEN` dynamically at container start. Not using this requires a valid `RUNNER_TOKEN` |
| `ORG_RUNNER` | Only valid if using `ACCESS_TOKEN`. This will set the runner to an org runner. Default is 'false'. Valid values are 'true' or 'false'. If this is set to true you must also set `ORG_NAME` and makes `REPO_URL` unneccesary |
| `ORG_NAME` | The organization name for the runner to register under. Requires `ORG_RUNNER` to be 'true'. No default value. |
| `LABELS` | A comma separated string to indicate the labels. Default is 'default' |
| `REPO_URL` | If using a non-organization runner this is the full repository url to register under such as 'https://github.com/myoung34/repo' |
| `RUNNER_TOKEN` | If not using a PAT for `ACCESS_TOKEN` this will be the runner token provided by the Add Runner UI (a manual process). Note: This token is short lived and will change frequently. `ACCESS_TOKEN` is likely preferred. |
| `RUNNER_WORKDIR` | The working directory for the runner. Runners on the same host should not share this directory. Default is '/_work'. This must match the source path for the bind-mounted volume at RUNNER_WORKDIR, in order for container actions to access files. |
## Examples ##
Manual:
### Note ###
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" \
# org runner
docker run -d --restart always --name github-runner \
-e RUNNER_NAME_PREFIX="myrunner" \
-e ACCESS_TOKEN="footoken" \
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
-e ORG_RUNNER="true" \
-e ORG_NAME="octokode" \
-e LABELS="my-label,other-label" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
myoung34/github-runner:latest
# per repo
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-your-repo" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
myoung34/github-runner:latest
```
Or as an alias:
Or shell wrapper:
```
function run-server {
name=github-actions-$(echo $1 | sed 's/\//-/g')
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/$1" -e RUNNER_TOKEN="$2" -v /var/run/docker.sock:/var/run/docker.sock --name $name github-runner:latest
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-${repo}" \
-e LABELS="my-label,other-label" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-${repo}:/tmp/github-runner-${repo} \
--name $name ${org}/github-runner:${tag}
}
run-server your-account/your-repo AARGHTHISISYOURGHACTIONSTOKEN
run-server your-account/some-other-repo ARGHANOTHERGITHUBACTIONSTOKEN
github-runner your-account/your-repo AARGHTHISISYOURGHACTIONSTOKEN
github-runner your-account/some-other-repo ARGHANOTHERGITHUBACTIONSTOKEN ubuntu-xenial
```
Nomad:
Or `docker-compose.yml`:
```yml
version: '2.3'
services:
worker:
build: .
image: myoung34/github-runner:latest
environment:
REPO_URL: https://github.com/example/repo
RUNNER_NAME: example-name
RUNNER_TOKEN: someGithubTokenHere
RUNNER_WORKDIR: /tmp/runner/work
ORG_RUNNER: 'false'
LABELS: linux,x64,gpu
security_opt:
# needed on SELinux systems to allow docker container to manage other docker containers
- label:disable
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- '/tmp/runner:/tmp/runner'
# note: a quirk of docker-in-docker is that this path
# needs to be the same path on host and inside the container,
# docker mgmt cmds run outside of docker but expect the paths from within
```
### Nomad ###
```
job "github_runner" {
@@ -45,22 +121,81 @@ job "github_runner" {
driver = "docker"
env {
REPO_URL = "https://github.com/myoung34/LEDSpicer"
RUNNER_TOKEN = "footoken"
ACCESS_TOKEN = "footoken"
RUNNER_NAME_PREFIX = "myrunner" \
RUNNER_WORKDIR = "/tmp/github-runner-your-repo"
ORG_RUNNER = "true"
ORG_NAME = "octokode"
LABELS = "my-label,other-label"
}
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: ORG_RUNNER
value: true
- name: ORG_NAME
value: octokode
- name: LABELS
value: my-label,other-label
- name: RUNNER_TOKEN
value: footoken
- name: REPO_URL
value: https://github.com/your-account/your-repo
- name: RUNNER_NAME_PREFIX
value: foo
- 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
@@ -77,3 +212,34 @@ 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 RUNNER_NAME="foo-runner" \
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
-e ORG_RUNNER="true" \
-e ORG_NAME="octokode" \
-e LABELS="my-label,other-label" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
myoung34/github-runner:latest
```
## Create GitHub personal access token ##
Creating GitHub personal access token (PAT) for using by self-hosted runner make sure the following scopes are selected:
* repo (all)
* admin:org (all) **_(mandatory for organization-wide runner)_**
* admin:public_key - read:public_key
* admin:repo_hook - read:repo_hook
* admin:org_hook
* notifications
* workflow
Also, when creating a PAT for self-hosted runner which will process events from several repositories of the particular organization, create the PAT using organization owner account. Otherwise your new PAT will not have sufficient privileges for all repositories.
+23
View File
@@ -0,0 +1,23 @@
## Security
If you believe you have found a security vulnerability, please report it to me as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to me directly at [myoung34@my.apsu.edu](mailto:myoung34@my.apsu.edu).
If you'd like to communicate securely, my keybase is [here](https://keybase.io/3vilpenguin)
Please include the requested information listed below (as much as you can provide) to help better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
## Preferred Languages
I prefer all communications to be in English.
+34 -3
View File
@@ -1,7 +1,38 @@
#!/bin/bash
export RUNNER_ALLOW_RUNASROOT=1
export PATH=$PATH:/actions-runner
_RUNNER_NAME=${RUNNER_NAME:-default}
deregister_runner() {
echo "Caught SIGTERM. Deregistering runner"
_TOKEN=$(bash /token.sh)
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
./config.sh remove --token "${RUNNER_TOKEN}"
exit
}
_RUNNER_NAME=${RUNNER_NAME:-${RUNNER_NAME_PREFIX:-github-runner}-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')}
_RUNNER_WORKDIR=${RUNNER_WORKDIR:-/_work}
config.sh --url "${REPO_URL}" --token "${RUNNER_TOKEN}" --name "${_RUNNER_NAME}" --work "${_RUNNER_WORKDIR}"
exec run.sh
_LABELS=${LABELS:-default}
_SHORT_URL=${REPO_URL}
if [[ -n "${ACCESS_TOKEN}" ]]; then
_TOKEN=$(bash /token.sh)
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
_SHORT_URL=$(echo "${_TOKEN}" | jq -r .short_url)
fi
echo "Configuring"
./config.sh \
--url "${_SHORT_URL}" \
--token "${RUNNER_TOKEN}" \
--name "${_RUNNER_NAME}" \
--work "${_RUNNER_WORKDIR}" \
--labels "${_LABELS}" \
--unattended \
--replace
unset RUNNER_TOKEN
trap deregister_runner SIGINT SIGQUIT SIGTERM
./bin/runsvc.sh
+7 -6
View File
@@ -1,13 +1,14 @@
#!/bin/bash -x
GH_RUNNER_VERSION=$1
TARGETPLATFORM=$2
export ACTIONS_ARCH="x64"
if [[ $(dpkg --print-architecture) == "armhf" ]]; then
export ACTIONS_ARCH="arm"
elif [[ $(dpkg --print-architecture) == "arm64" ]]; then
export ACTIONS_ARCH="arm64"
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-x64-${GH_RUNNER_VERSION}.tar.gz" > actions.tar.gz
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
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
_ORG_RUNNER=${ORG_RUNNER:-false}
URI=https://api.github.com
API_VERSION=v3
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
AUTH_HEADER="Authorization: token ${ACCESS_TOKEN}"
REPO_URL=${REPO_URL:-${URI}}
_PROTO="$(echo "${REPO_URL}" | grep :// | sed -e's,^\(.*://\).*,\1,g')"
# shellcheck disable=SC2116
_URL="$(echo "${REPO_URL/${_PROTO}/}")"
_PATH="$(echo "${_URL}" | grep / | cut -d/ -f2-)"
_ACCOUNT="$(echo "${_PATH}" | cut -d/ -f1)"
_REPO="$(echo "${_PATH}" | cut -d/ -f2)"
_FULL_URL="${URI}/repos/${_ACCOUNT}/${_REPO}/actions/runners/registration-token"
if [[ ${_ORG_RUNNER} == "true" ]]; then
[[ -z ${ORG_NAME} ]] && ( echo "ORG_NAME required for org runners"; exit 1 )
_FULL_URL="${URI}/orgs/${ORG_NAME}/actions/runners/registration-token"
_SHORT_URL="${_PROTO}github.com/${ORG_NAME}"
else
_SHORT_URL=$REPO_URL
fi
RUNNER_TOKEN="$(curl -XPOST -fsSL \
-H "${AUTH_HEADER}" \
-H "${API_HEADER}" \
"${_FULL_URL}" \
| jq -r '.token')"
echo "{\"token\": \"${RUNNER_TOKEN}\", \"short_url\": \"${_SHORT_URL}\", \"full_url\": \"${_FULL_URL}\"}"