-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Devin Buhl <devin@buhl.casa>
- Loading branch information
Showing
4 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy@sha256:b3854ec93a38e2ef0cb4e28376e4abb1365520dd9bc100ae797038796ea0e8c7 | ||
|
||
ARG VERSION | ||
# renovate: datasource=github-releases depName=actions/runner-container-hooks | ||
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.5.0 | ||
ARG DOCKER_VERSION=24.0.7 | ||
ARG DOCKER_COMPOSE_VERSION=v2.23.0 | ||
|
||
ARG TARGETPLATFORM | ||
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
LANG=en_US.UTF-8 \ | ||
RUNNER_MANUALLY_TRAP_SIG=1 \ | ||
ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1 \ | ||
HOMEBREW_NO_AUTO_UPDATE=1 \ | ||
HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=3650 | ||
|
||
RUN \ | ||
set -eux \ | ||
&& apt-get -qq update \ | ||
&& apt-get install -y \ | ||
bash \ | ||
ca-certificates \ | ||
curl \ | ||
git \ | ||
iptables \ | ||
jo \ | ||
jq \ | ||
locales \ | ||
moreutils \ | ||
software-properties-common \ | ||
sudo \ | ||
tzdata \ | ||
unrar \ | ||
unzip \ | ||
wget \ | ||
zip \ | ||
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN \ | ||
adduser --disabled-password --gecos "" --uid 1001 runner \ | ||
&& groupadd docker --gid 123 \ | ||
&& usermod -aG sudo runner \ | ||
&& usermod -aG docker runner \ | ||
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \ | ||
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers | ||
|
||
ENV RUNNER_ASSETS_DIR=/home/runner | ||
RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ | ||
&& if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x64 ; fi \ | ||
&& mkdir -p "$RUNNER_ASSETS_DIR" \ | ||
&& cd "$RUNNER_ASSETS_DIR" \ | ||
&& curl -fLo runner.tar.gz https://github.com/actions/runner/releases/download/v${VERSION}/actions-runner-linux-${ARCH}-${VERSION}.tar.gz \ | ||
&& tar xzf ./runner.tar.gz \ | ||
&& rm -f runner.tar.gz \ | ||
&& ./bin/installdependencies.sh \ | ||
# libyaml-dev is required for ruby/setup-ruby action. | ||
# It is installed after installdependencies.sh and before removing /var/lib/apt/lists | ||
# to avoid rerunning apt-update on its own. | ||
&& apt-get install -y libyaml-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV RUNNER_TOOL_CACHE=/opt/hostedtoolcache | ||
RUN mkdir /opt/hostedtoolcache \ | ||
&& chgrp docker /opt/hostedtoolcache \ | ||
&& chmod g+rwx /opt/hostedtoolcache | ||
|
||
RUN cd "$RUNNER_ASSETS_DIR" \ | ||
&& curl -fLo runner-container-hooks.zip https://github.com/actions/runner-container-hooks/releases/download/v${RUNNER_CONTAINER_HOOKS_VERSION}/actions-runner-hooks-k8s-${RUNNER_CONTAINER_HOOKS_VERSION}.zip \ | ||
&& unzip ./runner-container-hooks.zip -d ./k8s \ | ||
&& rm -f runner-container-hooks.zip | ||
|
||
RUN set -vx; \ | ||
export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ | ||
&& if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \ | ||
&& if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x86_64 ; fi \ | ||
&& curl -fLo docker.tgz https://download.docker.com/linux/static/stable/${ARCH}/docker-${DOCKER_VERSION}.tgz \ | ||
&& tar zxvf docker.tgz \ | ||
&& install -o root -g root -m 755 docker/* /usr/bin/ \ | ||
&& rm -rf docker docker.tgz | ||
|
||
RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ | ||
&& if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \ | ||
&& if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x86_64 ; fi \ | ||
&& mkdir -p /usr/libexec/docker/cli-plugins \ | ||
&& curl -fLo /usr/libexec/docker/cli-plugins/docker-compose https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-${ARCH} \ | ||
&& chmod +x /usr/libexec/docker/cli-plugins/docker-compose \ | ||
&& ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose \ | ||
&& which docker-compose \ | ||
&& docker compose version | ||
|
||
WORKDIR /home/runner | ||
USER runner | ||
|
||
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | ||
|
||
CMD ["/home/runner/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#file | ||
file: | ||
/usr/bin/docker: | ||
exists: true | ||
/usr/bin/git: | ||
exists: true | ||
/home/linuxbrew/.linuxbrew/bin/brew: | ||
exists: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
version=$(curl -sX GET "https://api.github.com/repos/actions/runner/releases/latest" | jq --raw-output '.tag_name') | ||
version="${version#*v}" | ||
version="${version#*release-}" | ||
printf "%s" "${version}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
app: github-actions-runner | ||
base: false | ||
semantic_versioning: true | ||
channels: | ||
- name: stable | ||
platforms: ["linux/amd64", "linux/arm64"] | ||
stable: true | ||
tests: | ||
enabled: true | ||
type: cli |