FROM archlinux:latest # Base system + toolchain deps RUN pacman -Sy --noconfirm archlinux-keyring && \ pacman-key --init && \ pacman-key --populate archlinux && \ pacman -Syu --noconfirm && \ pacman -S --noconfirm --needed \ base-devel git sudo xdotool # Create non-root build user for AUR RUN useradd -m -G wheel -s /bin/bash builder && \ echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder USER builder WORKDIR /home/builder # Install yay from AUR RUN git clone https://aur.archlinux.org/yay.git /home/builder/yay && \ cd /home/builder/yay && \ makepkg -si --noconfirm # Use yay to install claude-code (or claude-code-stable) RUN yay -S --noconfirm claude-code # Optional: switch back to root for cleanup USER root RUN rm -rf /home/builder/yay && \ pacman -Scc --noconfirm # Default working user/environment USER builder WORKDIR /home/builder