-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alpine version #37
Comments
won't work because the github runner is not musl compatible. I tried on a barebone alpine installation |
I did try and here is the diff anyone can re-use CLI output
the patch
diff --git a/docker/Dockerfile b/docker/Dockerfile
index b3dfd01..956bca2 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -1,8 +1,6 @@
-ARG FROM=debian:buster-slim
+ARG FROM=mcr.microsoft.com/dotnet/runtime-deps:3.1-alpine
FROM ${FROM}
-ARG DEBIAN_FRONTEND=noninteractive
-ARG GIT_VERSION="2.26.2"
ARG GH_RUNNER_VERSION
ARG DOCKER_COMPOSE_VERSION="1.27.4"
@@ -27,49 +25,30 @@ LABEL maintainer="[email protected]" \
org.label-schema.vendor="Thomas Cardonne" \
org.label-schema.docker.cmd="docker run -it tcardonne/github-runner:latest"
-RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
- apt-get install -y \
+RUN apk add --update-cache --no-cache \
curl \
unzip \
- apt-transport-https \
- ca-certificates \
- software-properties-common \
- sudo \
supervisor \
jq \
- iputils-ping \
- build-essential \
- zlib1g-dev \
- gettext \
- liblttng-ust0 \
- libcurl4-openssl-dev \
- openssh-client && \
- rm -rf /var/lib/apt/lists/* && \
- apt-get clean
+ openssh-client \
+ git-lfs \
+ docker \
+ git \
+ tar \
+ bash \
+ nodejs \
+ # Needed by the runner
+ libc6-compat \
+ && ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN chmod 644 /etc/supervisor/conf.d/supervisord.conf
-# Install Docker CLI
-RUN curl -fsSL https://get.docker.com -o- | sh && \
- rm -rf /var/lib/apt/lists/* && \
- apt-get clean
-
# Install Docker-Compose
RUN curl -L -o /usr/local/bin/docker-compose \
"https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" && \
chmod +x /usr/local/bin/docker-compose
-RUN cd /tmp && \
- curl -sL -o git.tgz \
- https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz && \
- tar zxf git.tgz && \
- cd git-${GIT_VERSION} && \
- ./configure --prefix=/usr && \
- make && \
- make install && \
- rm -rf /tmp/*
-
RUN mkdir -p /home/runner ${AGENT_TOOLSDIRECTORY}
WORKDIR /home/runner
@@ -78,10 +57,7 @@ RUN GH_RUNNER_VERSION=${GH_RUNNER_VERSION:-$(curl --silent "https://api.github.c
&& curl -L -O https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& tar -zxf actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& rm -f actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
- && ./bin/installdependencies.sh \
- && chown -R root: /home/runner \
- && rm -rf /var/lib/apt/lists/* \
- && apt-get clean
+ && chown -R root: /home/runner
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
|
@williamdes so the diff you shared, does that work? Why not open a PR? |
Well as you can see on the output there is still 2 things I can not fix, if you find how to do I will open a pull-request :) |
Another approach would be to add libc. I saw it in a different project the other day: https://github.com/disaster37/alpine-minio/blob/master/Dockerfile#L38 Basically they're patching libc into alpine to be able to run minio. Could work with the runner too |
Still no success 😟
ARG FROM=mcr.microsoft.com/dotnet/runtime-deps:3.1-alpine
FROM ${FROM}
ARG GH_RUNNER_VERSION
ARG DOCKER_COMPOSE_VERSION="1.27.4"
ENV RUNNER_NAME=""
ENV RUNNER_WORK_DIRECTORY="_work"
ENV RUNNER_TOKEN=""
ENV RUNNER_REPOSITORY_URL=""
ENV RUNNER_LABELS=""
ENV RUNNER_ALLOW_RUNASROOT=true
ENV GITHUB_ACCESS_TOKEN=""
ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
# Labels.
LABEL maintainer="[email protected]" \
org.label-schema.schema-version="1.0" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.name="tcardonne/github-runner" \
org.label-schema.description="Dockerized GitHub Actions runner." \
org.label-schema.url="https://github.com/tcardonne/docker-github-runner" \
org.label-schema.vcs-url="https://github.com/tcardonne/docker-github-runner" \
org.label-schema.vendor="Thomas Cardonne" \
org.label-schema.docker.cmd="docker run -it tcardonne/github-runner:latest"
RUN apk add --update --no-cache \
curl \
unzip \
supervisor \
jq \
openssh-client \
git-lfs \
docker \
git \
tar \
bash \
# Needed by the runner
# Does not work more that without
libc6-compat \
# https://github.com/sgerrand/alpine-pkg-glibc/issues/80#issuecomment-574885208
# Does not work more that without
libstdc++
# && ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 # not needed anymore with a newer glib version
ENV GLIBC_VERSION="2.32-r0"
RUN \
apk add --update --no-cache -t deps ca-certificates &&\
cd /tmp &&\
curl -# -L -o /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub &&\
curl -# -L -O https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk &&\
curl -# -L -O https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk &&\
apk add --force-overwrite glibc-${GLIBC_VERSION}.apk glibc-bin-${GLIBC_VERSION}.apk && rm *.apk &&\
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib/
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN chmod 644 /etc/supervisor/conf.d/supervisord.conf
# Install Docker-Compose
RUN curl -# -L -o /usr/local/bin/docker-compose \
"https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" && \
chmod +x /usr/local/bin/docker-compose
RUN mkdir -p /home/runner ${AGENT_TOOLSDIRECTORY}
WORKDIR /home/runner
RUN GH_RUNNER_VERSION=${GH_RUNNER_VERSION:-$(curl --silent "https://api.github.com/repos/actions/runner/releases/latest" | grep tag_name | sed -E 's/.*"v([^"]+)".*/\1/')} \
&& curl -# -L -O https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& tar -zxf actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& rm -f actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& chown -R root: /home/runner
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] |
An alpine version would be beneficial
The text was updated successfully, but these errors were encountered: