add archlinux dev environmental dockerfile

This commit is contained in:
DefectingCat
2023-11-20 13:58:08 +08:00
parent a2fc848465
commit d15f866ea5
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,28 @@
FROM archlinux
RUN pacman -Syu --noconfirm \
&& pacman -S --needed base-devel git zsh vim neovim fzf ripgrep --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}
USER ${USER}
WORKDIR /home/${USER}
RUN git clone https://aur.archlinux.org/yay.git
WORKDIR /home/${USER}/yay
RUN makepkg -si --noconfirm
WORKDIR /home/${USER}
RUN rm -rf yay \
&& sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" \
&& git clone https://github.com/DefectingCat/dotfiles \
&& chmod +x /home/${USER}/dotfiles/zsh/install.sh \
&& cp -aR /home/${USER}/dotfiles/zsh/zshrc-linux /home/${USER}/.zshrc \
&& ./home/${USER}/dotfiles/zsh/install.sh \
&& git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 \
&& cp -aR /home/${USER}/dotfiles/nvim/lua/custom /home/${USER}/.config/nvim/lua/
ENTRYPOINT ["/bin/zsh"]

View File

@ -124,4 +124,3 @@ fi
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup