From 50dfe2cd790388fcb12f9bc82f9c42ba4895dddc Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Tue, 26 Sep 2023 23:30:03 -0700 Subject: [PATCH] feat: Add 2nd image for amdgpupro --- .github/workflows/build.yml | 2 +- Containerfile | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 003441f..81f8b4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - base_name: [arch-distrobox] + base_name: [arch-distrobox, arch-distrobox-amdgpupro] include: - is_latest_version: true is_stable_version: true diff --git a/Containerfile b/Containerfile index e96dcc6..68d2d0b 100644 --- a/Containerfile +++ b/Containerfile @@ -101,3 +101,37 @@ RUN sed -i 's@#en_US.UTF-8@en_US.UTF-8@g' /etc/locale.gen && \ rm -rf \ /tmp/* \ /var/cache/pacman/pkg/* + +FROM arch-distrobox AS arch-distrobox-amdgpupro + +# Install amdgpu-pro, remove other drivers +RUN pacman -R \ + libglvnd \ + vulkan-intel \ + vulkan-radeon \ + mesa \ + --noconfirm && \ + useradd -m --shell=/bin/bash build && usermod -L build && \ + echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + +USER build +WORKDIR /home/build +RUN paru -S \ + amdgpu-pro-oglp \ + lib32-amdgpu-pro-oglp \ + vulkan-amdgpu-pro \ + lib32-vulkan-amdgpu-pro \ + amf-amdgpu-pro \ + --noconfirm +USER root +WORKDIR / + +# 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/*