Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Updated to latest ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
djthorpe committed Oct 3, 2021
1 parent 0d65067 commit 351100a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# base
FROM ubuntu:18.04
FROM ubuntu:20.04

# set the github runner version
ARG RUNNER_VERSION="2.283.1"
ARG RUNNER_ARCH="arm"

# update the base packages and add a non-sudo user
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Berlin"
RUN apt-get update -y && apt-get upgrade -y && useradd -m docker

# install python and the packages the your code depends on along with jq so we can parse JSON
Expand All @@ -25,7 +26,7 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | g
# https://docs.docker.com/engine/install/ubuntu/
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
&& echo "deb [arch=armhf signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update -y && apt-get install -y docker-ce docker-ce-cli containerd.io
&& apt-get update -y && apt-get install -y docker-compose containerd.io

# install pkg-config libsqlite3-dev
RUN apt-get update -y && apt-get install -y pkg-config libsqlite3-dev
Expand Down
17 changes: 12 additions & 5 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,29 @@ REG_TOKEN=$(curl -sX POST -H "Authorization: token ${ACCESS_TOKEN}" https://api.

# Configure the runner
cd /home/docker/actions-runner
gosu docker ./config.sh --url https://github.com/${ORGANIZATION} --token ${REG_TOKEN}
gosu docker ./config.sh --url https://github.com/${ORGANIZATION} --token ${REG_TOKEN} \
--name "${NAME}" \
--labels "${LABELS}" \
--runnergroup "${GROUP}" \
--unattended \
--replace

# Trap signals and cleanup
cleanup() {
echo "Removing runner..."
gosu docker ./config.sh remove --unattended --token ${REG_TOKEN}
exit
}

trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM
# Deregister runner on exit
trap cleanup SIGINT SIGQUIT SIGTERM INT TERM QUIT

# Set the docker permissions
echo "Setting docker permissions..."
if [ -e "/var/run/docker.sock" ] ; then
chmod 666 /var/run/docker.sock
fi

# Run the runner
gosu docker ./run.sh & wait $!
# Run
gosu docker ./run.sh

0 comments on commit 351100a

Please sign in to comment.