1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-12-22 07:31:39 +01:00
dotfiles/Dockerfile

Failed to ignore revisions in .git-blame-ignore-revs.

71 lines
1.8 KiB
Docker
Raw Normal View History

2022-01-30 18:09:35 +01:00
FROM archlinux:latest as base
ENV TERM=xterm-256color
ENV DOTFILES=/root/.dotfiles
RUN pacman --noconfirm -Syu && pacman --noconfirm -Sy \
vim \
tmux \
git \
fzf \
base-devel \
ipython \
python-pip \
htop \
2023-12-28 17:38:47 +01:00
python-ruff \
2022-01-30 18:09:35 +01:00
python-virtualenv \
bash-language-server \
&& rm -rf /var/cache/pacman/pkg/*
2022-02-07 21:10:44 +01:00
# Enable colors in pacman
RUN sed -i 's/^#Color/Color/' /etc/pacman.conf
2023-12-28 17:57:44 +01:00
FROM base as builder
2022-01-30 18:09:35 +01:00
2023-12-28 17:57:44 +01:00
# Cannot run makepkg as root: add build user
RUN useradd build && echo "build ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
2022-01-30 18:09:35 +01:00
2023-12-28 17:57:44 +01:00
USER build
2022-01-30 18:09:35 +01:00
2023-12-28 17:57:44 +01:00
# yay (pre-compiled) and bretellofier
2022-01-30 18:09:35 +01:00
WORKDIR /home/build/yay
2023-12-28 17:57:44 +01:00
RUN git clone https://aur.archlinux.org/yay-bin.git /home/build/yay && \
git clone https://aur.archlinux.org/bretellofier.git /home/build/bretellofier && \
cd /home/build/yay && env GOCACHE=/home/build makepkg --syncdeps --noconfirm && \
cd /home/build/bretellofier && makepkg --syncdeps --noconfirm
2022-01-30 18:09:35 +01:00
FROM base as final
WORKDIR /root
2023-12-28 17:57:44 +01:00
RUN pacman -Sy --noconfirm zsh && chsh -s /bin/zsh
2022-01-30 18:09:35 +01:00
2023-12-28 17:57:44 +01:00
COPY --from=builder /home/build/yay/*zst /tmp/
COPY --from=builder /home/build/bretellofier/*zst /tmp/
2022-01-30 18:09:35 +01:00
RUN pacman --noconfirm -U /tmp/*zst && rm -rf /tmp/*zst
# antibody
RUN curl -sL https://git.io/antibody | sh -s - -b /usr/local/bin
# vim-plug
RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
2022-02-07 21:10:44 +01:00
RUN git clone https://git.decapod.one/brethil/dotfiles ${DOTFILES}
COPY . ${DOTFILES}
2022-01-30 18:09:35 +01:00
WORKDIR /root/
2023-12-28 17:57:44 +01:00
RUN echo -e "export DOTFILES=/root/.dotfiles\nsource \$DOTFILES/brethil_dotfile.sh" >> .zshrc && \
ln -s $DOTFILES/vim/vimrc .vimrc && \
ln -s $DOTFILES/tmux.conf .tmux.conf && \
echo -e "[include]\npath = $DOTFILES/gitconfig" >> .gitconfig
2022-01-30 18:09:35 +01:00
# Install vim plugins
2022-02-07 21:10:44 +01:00
RUN vim -c 'PlugInstall|qa!'
2022-01-30 18:09:35 +01:00
# Install zsh plugins
2023-12-28 17:57:44 +01:00
RUN zsh -c exit
2022-01-30 18:09:35 +01:00
2024-01-03 15:43:54 +01:00
CMD ["tmux"]