현재 Github action self hosted runner 구성은 서버에 프로세스 형태로 구성하기 또는 쿠버네티스에 ARC 로 구성하는 방법이 있습니다.

 

참고 : 

 ARC : https://tech.buzzvil.com/blog/%EC%BF%A0%EB%B2%84%EB%84%A4%ED%8B%B0%EC%8A%A4%EC%97%90%EA%B2%8C-github-actions-%EC%84%A4%EC%B9%98%EC%97%90-%EB%8C%80%ED%95%B4-%EB%AC%BB%EB%8B%A4/

 

 

GitHub Actionsでself-hosted runnersをDockerで作る - Qiita

https://docs.github.com/ja/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self…

qiita.com

 

 

저는 특정 상황 때문에 이미지 파일로 구성하려고 합니다. 

 

도커 파일 

FROM ubuntu:22.04


ARG PERSONAL_ACCESS_TOKEN
ARG HOST=https://github.com
ARG ORGANIZATION
ARG REPOSITORY

ENV BINARY_URL=https://github.com/actions/runner/releases/download/v2.315.0/actions-runner-linux-x64-2.315.0.tar.gz

ENV RUNNER_NAME=myRunner
ENV RUNNER_GROUP=Default
ENV RUNNER_LABELS="self-hosted,Linux"
ENV RUNNER_WORKDIR=_work

RUN apt-get update && \
    apt-get install -y dotnet-sdk-6.0 curl sudo && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN useradd runner && \
    echo "runner:runner" | chpasswd && \
    chsh -s /usr/bin/bash runner && \
    usermod -aG sudo runner && \
    mkdir /actions-runner && \

    chown runner:runner /actions-runner

USER runner
WORKDIR /actions-runner

RUN curl -fsSL -o actions-runner-linux-x64-2.315.0.tar.gz -L $BINARY_URL && \
    tar xf ./actions-runner-linux-x64-2.315.0.tar.gz && \
    rm actions-runner-linux-x64-2.315.0.tar.gz && \
    rm actions-runner.tar.gz && \
    echo $PERSONAL_ACCESS_TOKEN && \
    ./config.sh \
        --unattended \
        --url $HOST/$ORGANIZATION/$REPOSITORY \
        --pat $PERSONAL_ACCESS_TOKEN \
 #      --token $PERSONAL_ACCESS_TOKEN \
        --name $RUNNER_NAME \
        --runnergroup $RUNNER_GROUP \
        --labels $RUNNER_LABELS \
        --work $RUNNER_WORKDIR

CMD ["nohup","./run.sh", "&"]

+ Recent posts