update arch dev dockerfile install script

This commit is contained in:
DefectingCat
2024-01-03 10:27:26 +08:00
parent 3f63c3509f
commit dcb171cc81
5 changed files with 37 additions and 16 deletions

View File

@ -16,9 +16,10 @@ RUN rm -rf /home/${USER}/dotfiles \
RUN chown -R "${USER}":"${USER}" /home/"${USER}"
USER ${USER}
COPY --chown=${USER} . /home/${USER}/dotfiles
RUN export USER="${USER}" \
&& git clone https://github.com/DefectingCat/dotfiles \
&& chmod +x /home/${USER}/dotfiles/scripts/* \
&& /home/${USER}/dotfiles/scripts/install-yay.sh \
&& /home/${USER}/dotfiles/scripts/install-archlinux.sh
WORKDIR /home/${USER}/dotfiles

View File

@ -2,3 +2,7 @@ FROM archlinux
ARG USER=xfy
RUN echo "${USER}"
WORKDIR /home/${USER}
COPY . .
RUN ls

View File

@ -1,4 +1,27 @@
FROM archlinux
ARG USER=xfy
WORKDIR /app
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 rm -rf /home/${USER}/dotfiles \
&& rm -rf /home/${USER}/yay
RUN chown -R "${USER}":"${USER}" /home/"${USER}"
USER ${USER}
COPY --chown=${USER} . /home/${USER}/dotfiles
RUN export USER="${USER}" \
&& chmod +x /home/${USER}/dotfiles/scripts/* \
&& /home/${USER}/dotfiles/scripts/install-yay.sh
WORKDIR /home/${USER}/actions-runner
RUN yay --noconfirm \
yay -S curl \
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

@ -1,10 +1,5 @@
#!/bin/bash
source ./install-yay.sh
# install yay
install_yay
cd /home/"$USER"/ || exit
# ohmyzsh

View File

@ -1,11 +1,9 @@
#!/bin/bash
install_yay() {
cd /home/"$USER"/ || exit
git clone https://aur.archlinux.org/yay.git
cd /home/"$USER"/yay || exit
makepkg -si --noconfirm
cd /home/"$USER"/ || exit
rm -rf yay
echo "install yay success"
}
cd /home/"$USER"/ || exit
git clone https://aur.archlinux.org/yay.git
cd /home/"$USER"/yay || exit
makepkg -si --noconfirm
cd /home/"$USER"/ || exit
rm -rf yay
echo "install yay success"