add github runner dockerfile

This commit is contained in:
DefectingCat
2024-01-03 10:55:22 +08:00
parent dcb171cc81
commit d2bbe10ec3
4 changed files with 29 additions and 10 deletions

View File

@ -3,4 +3,5 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

View File

@ -1,7 +1,7 @@
FROM archlinux
RUN pacman -Syu --noconfirm \
&& pacman -S --needed base-devel git zsh vim neovim fzf\
# RUN pacman -Syu --noconfirm \
RUN pacman -S --needed base-devel git zsh vim neovim fzf \
ripgrep lazygit go ranger openssh pyenv \
--noconfirm
@ -10,7 +10,7 @@ RUN useradd --groups wheel --no-create-home --shell /bin/zsh ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER} \
&& usermod -s "$(which zsh)" ${USER}
WORKDIR /home/${USER}
WORKDIR /home/${USER}
RUN rm -rf /home/${USER}/dotfiles \
&& rm -rf /home/${USER}/yay
@ -25,6 +25,6 @@ RUN export USER="${USER}" \
WORKDIR /home/${USER}/dotfiles
RUN scripts/update.sh
WORKDIR /home/${USER}
WORKDIR /home/${USER}
ENTRYPOINT ["/bin/zsh"]

View File

@ -3,11 +3,12 @@ FROM archlinux
ARG USER=xfy
ARG RUNNER_VERSION=2.311.0
RUN useradd --groups wheel --no-create-home --shell /bin/zsh ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER} \
&& usermod -s "$(which zsh)" ${USER}
WORKDIR /home/${USER}
RUN pacman -Syu --noconfirm \
&& pacman -S --needed git vim base-devel \
--noconfirm
RUN useradd --groups wheel --no-create-home --shell /bin/bash ${USER}
WORKDIR /home/${USER}
RUN rm -rf /home/${USER}/dotfiles \
&& rm -rf /home/${USER}/yay
@ -21,7 +22,7 @@ RUN export USER="${USER}" \
WORKDIR /home/${USER}/actions-runner
RUN yay --noconfirm \
yay -S curl \
curl -o actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
curl -o actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
-L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz

View File

@ -0,0 +1,17 @@
FROM ubuntu
ARG USER=xfy
ARG RUNNER_VERSION=2.311.0
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install curl -y
RUN useradd --no-create-home --shell /bin/bash ${USER}
WORKDIR /home/${USER}
RUN rm -rf /home/${USER}/dotfiles
WORKDIR /home/${USER}/actions-runner
RUN curl -o actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
-L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
&& tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz