diff --git a/Containerfile b/Containerfile index 28d9694..ca444c0 100644 --- a/Containerfile +++ b/Containerfile @@ -4,16 +4,27 @@ LABEL com.github.containers.toolbox="true" \ usage="This image is meant to be used with the toolbox or distrobox command" \ summary="My personal distrobox development environment" +# install packages COPY extra-packages / -RUN paru -Syu --noconfirm && \ - paru -S --needed - < /extra-packages -RUN rm /extra-packages +COPY aur-packages / + +RUN paru -Syu --noconfirm +RUN paru -S --noconfirm --needed $(cat /extra-packages) + +USER build +WORKDIR /home/build +RUN paru -S --noconfirm --needed $(cat /aur-packages) + +USER root +WORKDIR / + +RUN rm /extra-packages /aur-packages # change distrobox cache dir to keep distrobox and host fontconfig caches separate # prevents fonts from breaking between host and container due to changing paths RUN echo 'export XDG_CACHE_HOME="$HOME/.cache-distrobox"' > /etc/profile.d/cache-home.sh -# install Bun, and keep npm up to date (npm should be present as part of extra-packages above) +# install ts & its lsp RUN npm install -g typescript typescript-language-server RUN ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/docker && \ @@ -21,3 +32,13 @@ RUN ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/docker && \ ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/rpm-ostree && \ ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/transactional-update && \ ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/ujust + + +# Cleanup +RUN userdel -r build && \ + rm -drf /home/build && \ + sed -i '/build ALL=(ALL) NOPASSWD: ALL/d' /etc/sudoers && \ + sed -i '/root ALL=(ALL) NOPASSWD: ALL/d' /etc/sudoers && \ + rm -rf \ + /tmp/* \ + /var/cache/pacman/pkg/* diff --git a/aur-packages b/aur-packages new file mode 100644 index 0000000..ccbfcd5 --- /dev/null +++ b/aur-packages @@ -0,0 +1,2 @@ +visual-studio-code-bin +bun-bin diff --git a/extra-packages b/extra-packages index dc0bdb7..e0708ab 100644 --- a/extra-packages +++ b/extra-packages @@ -1,4 +1,3 @@ -visual-studio-code-bin dbus eza ffmpeg