Skip to content

Commit 10d0b70

Browse files
committed
feat: switch base image to GitHub runner and add DevOps tools
Replace ubuntu:24.04 base with ghcr.io/actions/runner for native GitHub Actions runner support. Add skopeo, Argo Workflows CLI, HashiCorp Packer, and Cloud Native Buildpacks (pack) CLI as configurable build args. https://claude.ai/code/session_01RofXXAMZxK4irobNYjYn3W
1 parent 20b6ec2 commit 10d0b70

2 files changed

Lines changed: 43 additions & 17 deletions

File tree

Containerfile

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
ARG UBUNTU_VERSION=24.04
1+
ARG RUNNER_VERSION=latest
22

3-
FROM docker.io/library/ubuntu:$UBUNTU_VERSION as base
3+
FROM ghcr.io/actions/runner:${RUNNER_VERSION} as base
44

5-
ARG APP_UID=1000
6-
ARG APP_HOME=/home/appuser
5+
ARG APP_HOME=/home/runner
76

8-
# Setup the non-root user
9-
RUN userdel --remove ubuntu \
10-
&& useradd \
11-
--no-log-init \
12-
--uid $APP_UID \
13-
--home-dir ${APP_HOME} \
14-
--create-home \
15-
--user-group \
16-
appuser && \
17-
chown -R appuser:appuser ${APP_HOME}
7+
USER root
188

199
# Update and upgrade the system
2010
RUN apt-get update \
@@ -35,6 +25,40 @@ RUN apt-get update \
3525
&& apt-get clean \
3626
&& rm -rf /var/lib/apt/lists/*
3727

28+
# Install skopeo
29+
# hadolint ignore=DL3008
30+
RUN apt-get update \
31+
&& apt-get install --no-install-recommends -y skopeo \
32+
&& apt-get clean \
33+
&& rm -rf /var/lib/apt/lists/*
34+
35+
# Install Argo Workflows CLI
36+
ARG ARGO_VERSION=3.6.4
37+
RUN curl -sSL -o /tmp/argo-linux-amd64.gz \
38+
"https://github.com/argoproj/argo-workflows/releases/download/v${ARGO_VERSION}/argo-linux-amd64.gz" \
39+
&& gunzip /tmp/argo-linux-amd64.gz \
40+
&& mv /tmp/argo-linux-amd64 /usr/local/bin/argo \
41+
&& chmod +x /usr/local/bin/argo
42+
43+
# Install HashiCorp Packer
44+
ARG PACKER_VERSION=1.11.2
45+
# hadolint ignore=DL3008
46+
RUN apt-get update \
47+
&& apt-get install --no-install-recommends -y unzip \
48+
&& curl -sSL -o /tmp/packer.zip \
49+
"https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" \
50+
&& unzip /tmp/packer.zip -d /usr/local/bin/ \
51+
&& rm /tmp/packer.zip \
52+
&& apt-get clean \
53+
&& rm -rf /var/lib/apt/lists/*
54+
55+
# Install pack (Cloud Native Buildpacks CLI)
56+
ARG PACK_VERSION=0.36.4
57+
RUN curl -sSL -o /tmp/pack.tgz \
58+
"https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" \
59+
&& tar -xzf /tmp/pack.tgz -C /usr/local/bin/ \
60+
&& rm /tmp/pack.tgz
61+
3862
# Install Poetry latest version and add it to PATH
3963
# hadolint ignore=DL4006
4064
RUN curl -sSL https://install.python-poetry.org | python3 -
@@ -54,7 +78,7 @@ LABEL org.opencontainers.image.licenses="MIT"
5478
LABEL org.opencontainers.image.authors="Deerhide"
5579
LABEL org.opencontainers.image.vendor="Deerhide"
5680

57-
USER ${APP_UID}
81+
USER runner
5882
WORKDIR ${APP_HOME}
5983

6084
# Install Poetry latest version and add it to PATH

manifest.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ registry: ghcr.io/deerhide/python-github-runner
55
build:
66
format: oci
77
args:
8-
- APP_UID=1000
9-
- UBUNTU_VERSION=24.04
8+
- RUNNER_VERSION=latest
9+
- ARGO_VERSION=3.6.4
10+
- PACKER_VERSION=1.11.2
11+
- PACK_VERSION=0.36.4
1012
labels:
1113
- org.opencontainers.image.source=https://github.com/deerhide/python-github-runner
1214
- org.opencontainers.image.description="Python GitHub Runner"

0 commit comments

Comments
 (0)