Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
REPO: ${{ github.event.repository.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up QEM
uses: docker/setup-qemu-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
REPO: ${{ github.event.repository.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up QEM
uses: docker/setup-qemu-action@v3
Expand Down
42 changes: 27 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,36 @@
ARG TARGETARCH
RUN echo "Detected architecture: ${TARGETARCH}"

ENV RUNNER_ARCH=${RUNNER_ARCH}

Check warning on line 11 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker-test

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$RUNNER_ARCH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 11 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker-test

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$RUNNER_ARCH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 11 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker-test

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$RUNNER_ARCH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
curl \
jq \
git \
tar \
nano \
sudo \
software-properties-common && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
chmod +x get-docker.sh && \
sh get-docker.sh && \
rm get-docker.sh
curl jq git tar nano sudo software-properties-common \
ca-certificates gnupg lsb-release && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y docker-ce-cli && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# RUN apt-get update && apt-get install -y \
# curl \
# jq \
# git \
# tar \
# nano \
# sudo \
# software-properties-common && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*

# RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
# chmod +x get-docker.sh && \
# sh get-docker.sh && \
# rm get-docker.sh

RUN sudo chown root:docker /var/run/docker.sock || true
WORKDIR /runner
Expand All @@ -50,7 +61,8 @@
RUN useradd -m -s /bin/bash runner && \
echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

RUN usermod -aG docker runner && su - runner -c "newgrp docker"
RUN groupadd -f docker && usermod -aG docker runner
# RUN usermod -aG docker runner && su - runner -c "newgrp docker"
RUN chown -R runner:runner /runner

COPY entrypoint.sh /entrypoint.sh
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@ You can set up the runner using either `docker run` or `docker-compose`. Choose
- GITHUB_URL=https://github.com/<your-org-or-repo>
- RUNNER_TOKEN=<your-runner-token>
- RUNNER_NAME=<your-runner-name>
- RUNNER_LABEL=<label1,label2>
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
# set runner resource limits [optional]
deploy:
resources:
limits:
cpus: "2.0"
memory: "4G"
reservations:
cpus: "0.5"
memory: "1024"


```

3. **Docker Compose - Multi Containers**
Expand All @@ -60,9 +72,19 @@ You can set up the runner using either `docker run` or `docker-compose`. Choose
- GITHUB_URL=https://github.com/<your-org-or-repo>
- RUNNER_TOKEN=<your-runner-token>
- RUNNER_NAME=<your-runner-name>
- RUNNER_LABEL=<label1,label2>
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
# set runner resource limits [optional]
deploy:
resources:
limits:
cpus: "2.0"
memory: "4G"
reservations:
cpus: "0.5"
memory: "1024"
```

4. **Kubernetes Deployment**
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ services:
- GITHUB_URL=https://github.com/<your-org-or-repo>
- RUNNER_TOKEN=<your-runner-token>
- RUNNER_NAME=<your-runner-name>
- RUNNER_LABEL=<label1,label2>
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
# set runner resource limits [optional]
deploy:
resources:
limits:
cpus: "2.0"
memory: "4G"
reservations:
cpus: "0.5"
memory: "1024"

Loading