76 lines
1.9 KiB
Docker
76 lines
1.9 KiB
Docker
FROM archlinux:latest
|
|
|
|
ENV TERM=xterm-256color
|
|
ENV COLORTERM=truecolor
|
|
|
|
# Update
|
|
RUN pacman -Syu --noconfirm
|
|
|
|
## Before anything, avoid some annoying warnings
|
|
RUN pacman -Sy --noconfirm glibc && \
|
|
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && \
|
|
locale-gen
|
|
|
|
ENV LANG=en_US.UTF-8
|
|
ENV LC_ALL=en_US.UTF-8
|
|
|
|
## Configure non-root user
|
|
RUN pacman -S --noconfirm sudo
|
|
RUN useradd -m -s /bin/bash -G wheel x
|
|
RUN PASS=$(openssl rand -base64 14) && echo "x:$PASS" | chpasswd && echo "Pass $PASS"
|
|
RUN echo 'x ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
|
USER x
|
|
WORKDIR /home/x
|
|
|
|
## Install Yay incase we need it
|
|
RUN sudo pacman -S --noconfirm git base-devel
|
|
COPY ./yay yay
|
|
RUN sudo chown -R x:x yay
|
|
RUN cd yay \
|
|
&& makepkg -si --noconfirm \
|
|
&& cd .. && rm -rf yay \
|
|
&& yay -Syu
|
|
|
|
## Install Neovim
|
|
RUN sudo pacman -S --needed --noconfirm \
|
|
neovim git curl unzip tar wget \
|
|
nodejs npm \
|
|
python python-pip \
|
|
lua \
|
|
go \
|
|
ripgrep \
|
|
fd \
|
|
gcc make base-devel \
|
|
xclip xsel wl-clipboard \
|
|
lazygit
|
|
RUN yay -Syu --noconfirm terraform-ls
|
|
RUN mkdir -p /home/x/.config/
|
|
COPY ./nvim /home/x/.config/nvim
|
|
# Should run Lazy update and keep the base image reasonably up to date
|
|
# Just to avoid lengthy startups but we'll see how this approach goes.
|
|
RUN nvim --headless "+Lazy! update" +qa
|
|
|
|
## Install OpenSSH
|
|
RUN sudo pacman -Sy --noconfirm openssh
|
|
|
|
# Install Tmux
|
|
RUN sudo pacman -S --noconfirm tmux
|
|
COPY tmux/tmux.conf /home/x/.tmux.conf
|
|
|
|
## Git
|
|
# Should already be installed for Yay but repeating stuff to keep everything in blocks
|
|
RUN sudo pacman -S --noconfirm git
|
|
RUN mkdir -p /home/x/.config/git
|
|
|
|
## Entrypoint
|
|
# This entrypoint allows us to avoid jank ssh agent jazz
|
|
USER root
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chown x:x /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
USER x
|
|
|
|
## Quick drop password at end of build output
|
|
RUN echo "Your password: $PASS"
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|