forked from ublue-os/arch-distrobox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
68 lines (61 loc) · 2.48 KB
/
Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM quay.io/toolbx-images/archlinux-toolbox AS arch-distrobox
# Pacman Initialization
# Create build user
RUN sed -i 's/#Color/Color/g' /etc/pacman.conf && \
sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$(nproc)"/g' /etc/makepkg.conf && \
pacman-key --init && pacman-key --populate && \
pacman -Syu --noconfirm && \
pacman -S \
wget \
base-devel \
git \
--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
# Distrobox Integration
USER build
WORKDIR /home/build
RUN git clone https://github.com/KyleGospo/xdg-utils-distrobox-arch.git --single-branch && \
cd xdg-utils-distrobox-arch/trunk && \
makepkg -si --noconfirm && \
cd ../.. && \
rm -drf xdg-utils-distrobox-arch
USER root
WORKDIR /
RUN git clone https://github.com/89luca89/distrobox.git --single-branch /tmp/distrobox && \
cp /tmp/distrobox/distrobox-host-exec /usr/bin/distrobox-host-exec && \
ln -s /usr/bin/distrobox-host-exec /usr/bin/flatpak && \
ln -s /usr/bin/distrobox-host-exec /usr/bin/docker && \
ln -s /usr/bin/distrobox-host-exec /usr/bin/podman && \
ln -s /usr/bin/distrobox-host-exec /usr/bin/rpm-ostree && \
ln -s /usr/bin/distrobox-host-exec /usr/bin/distrobox && \
wget -q https://github.com/1player/host-spawn/releases/download/$(cat /tmp/distrobox/distrobox-host-exec | grep host_spawn_version= | cut -d "\"" -f 2)/host-spawn-$(uname -m) -O /usr/bin/host-spawn && \
chmod +x /usr/bin/host-spawn && \
rm -drf /tmp/distrobox
# Distrobox base packages+tweaks
COPY pacman-packages /
COPY aur-packages /
RUN grep -v '^#' /pacman-packages | xargs pacman -Syu --noconfirm --needed
USER build
WORKDIR /home/build
RUN git clone https://aur.archlinux.org/paru-bin.git --single-branch && \
cd paru-bin && \
makepkg -si --noconfirm && \
rm -drf /home/build/paru-bin && \
grep -v '^#' /aur-packages | xargs paru -Syu --noconfirm --needed
USER root
WORKDIR /
# Cleanup
RUN sed -i 's@#en_US.UTF-8@en_US.UTF-8@g' /etc/locale.gen && \
echo "LANG=en_US.UTF-8" >> /etc/locale.conf && \
locale-gen && \
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/* \
/pacman-packages \
/aur-packages