Skip to content

Commit

Permalink
feat(image): fix build and add tools
Browse files Browse the repository at this point in the history
  • Loading branch information
JPBM135 committed Jan 27, 2024
1 parent 0bf0e5b commit 0122178
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: field-control/actions-runner
IMAGE_NAME: fieldcontrol/actions-runner

jobs:
build:
Expand Down Expand Up @@ -64,5 +64,5 @@ jobs:
push: true
labels: |
org.opencontainers.image.source=${{github.server_url}}/${{github.repository}}
org.opencontainers.image.description=https://github.com/actions/runner/releases/tag/v${{ steps.image.outputs.version }}
org.opencontainers.image.description=https://github.com/FieldControl/runner/releases/tag/v${{ steps.image.outputs.version }}
org.opencontainers.image.licenses=MIT
28 changes: 24 additions & 4 deletions images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Source: https://github.com/dotnet/dotnet-docker
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy as build

ARG TARGETOS
ARG TARGETARCH
ARG RUNNER_VERSION
ARG TARGETOS=linux
ARG TARGETARCH=arm64
ARG RUNNER_VERSION=1.0.0
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.5.0
ARG DOCKER_VERSION=24.0.6
ARG BUILDX_VERSION=0.11.2
Expand Down Expand Up @@ -48,18 +48,38 @@ RUN apt-get update -y \
jq \
git \
lsb-release \
build-essential \
ca-certificates \
gnome-terminal \
unzip \
zip \
wget \
&& rm -rf /var/lib/apt/lists/*

RUN curl -o- -L https://yarnpkg.com/install.sh | bash \
# Install yarn
RUN (curl -o- -L https://yarnpkg.com/install.sh | bash) || true \
&& export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

RUN mkdir -p /tmp/aws \
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/aws/awscliv2.zip" \
&& unzip /tmp/aws/awscliv2.zip -d /tmp/aws \
&& sudo /tmp/aws/aws/install

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

# Install docker
RUN install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& chmod a+r /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") 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 docker-buildx-plugin docker-compose-plugin

WORKDIR /home/runner

COPY --chown=runner:docker --from=build /actions-runner .
Expand Down
2 changes: 1 addition & 1 deletion releaseVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
2 changes: 1 addition & 1 deletion src/runnerversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1

0 comments on commit 0122178

Please sign in to comment.