update coder arch-dev dockerfile

This commit is contained in:
DefectingCat
2024-01-23 10:35:32 +08:00
parent 1468c2f837
commit d64bcfecd2
2 changed files with 39 additions and 2 deletions

View File

@ -0,0 +1,36 @@
FROM archlinux
RUN echo '' > /etc/pacman.d/mirrorlist \
&& echo 'Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist \
&& pacman -Syyu --noconfirm \
&& pacman-key --init \
&& pacman-key --populate archlinux \
&& pacman-key --refresh-keys \
&& pacman -Syy --needed base-devel git zsh vim neovim fzf \
ripgrep lazygit go ranger openssh pyenv \
--noconfirm
ARG USER=xfy
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}
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 \
&& yay --noconfirm
WORKDIR /home/${USER}/dotfiles
RUN scripts/update.sh
WORKDIR /home/${USER}
ENTRYPOINT ["/bin/zsh"]