mirror of
https://github.com/aleleba/docker-github-actions-runner.git
synced 2025-07-02 22:08:17 -06:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
fb431da060 | |||
d57fcf068b | |||
447646eb64 | |||
ce8da1ebfc | |||
4ce1f1f109 | |||
c75213effb |
19
Dockerfile
19
Dockerfile
@ -1,11 +1,26 @@
|
||||
# base
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Update Package
|
||||
RUN apt-get update
|
||||
# Install apt-utils
|
||||
RUN apt-get install -y --no-install-recommends apt-utils
|
||||
# Install Sudo
|
||||
RUN apt-get -y install sudo
|
||||
# Install Curl
|
||||
RUN apt-get -y install curl
|
||||
# Install VIM
|
||||
RUN apt-get -y install vim
|
||||
|
||||
# set the github runner version
|
||||
ARG RUNNER_VERSION="2.311.0"
|
||||
|
||||
# update the base packages and add a non-sudo user
|
||||
RUN apt-get update -y && apt-get upgrade -y && useradd -m docker
|
||||
# update the base packages, add a non-sudo user, and install Xvfb
|
||||
RUN apt-get update -y && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y xvfb libglib2.0-0 && \
|
||||
useradd -m docker && \
|
||||
echo 'docker ALL=(ALL) NOPASSWD:ALL' | tee -a /etc/sudoers
|
||||
|
||||
# install python and the packages the your code depends on along with jq so we can parse JSON
|
||||
# add additional packages as necessary
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Docker Github Action Runner
|
||||
|
||||
## Version 1.0.1
|
||||
## Version 1.0.7
|
7
start.sh
7
start.sh
@ -1,14 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
OWNER=$OWNER
|
||||
REPO=$REPO
|
||||
ORGANIZATION=$ORGANIZATION
|
||||
ACCESS_TOKEN=$ACCESS_TOKEN
|
||||
|
||||
REG_TOKEN=$(curl -sX POST -H "Authorization: token ${ACCESS_TOKEN}" https://api.github.com/repos/${OWNER}/${REPO}/actions/runners/registration-token | jq .token --raw-output)
|
||||
REG_TOKEN=$(curl -sX POST -H "Authorization: token ${ACCESS_TOKEN}" https://api.github.com/orgs/${ORGANIZATION}/actions/runners/registration-token | jq .token --raw-output)
|
||||
|
||||
cd /home/docker/actions-runner
|
||||
|
||||
./config.sh --url https://github.com/${OWNER}/${REPO} --token ${REG_TOKEN}
|
||||
./config.sh --url https://github.com/${ORGANIZATION} --token ${REG_TOKEN}
|
||||
|
||||
cleanup() {
|
||||
echo "Removing runner..."
|
||||
|
Reference in New Issue
Block a user