-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
47 lines (36 loc) · 1.24 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
FROM quay.io/toolbx-images/archlinux-toolbox:latest
LABEL name="toolbox"
LABEL maintainer="PopeRigby <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/poperigby/toolbox"
LABEL org.opencontainers.image.description="PopeRigby's personal toolbox"
LABEL com.github.containers.toolbox="true"
# Install packages
COPY packages.txt /
RUN pacman -Syu --needed --noconfirm - < packages.txt
RUN rm /packages.txt
# Create a non-root user for makepkg and switch to it
RUN useradd -m paru
USER paru
# Build paru
RUN git clone https://aur.archlinux.org/paru-bin.git /tmp/paru && \
cd /tmp/paru && \
makepkg -s --noconfirm
# Switch back to root
USER root
# Clean up non-root user
RUN userdel -r paru
# Install paru
RUN pacman -U --noconfirm /tmp/paru/paru-bin-*-x86_64.pkg.tar.zst && \
rm -rf /tmp/paru
# Clean up cache
RUN pacman -Scc --noconfirm
# Copy over scripts
COPY scripts /usr/local/bin/
RUN chmod +x /usr/local/bin/*
# Copy over /etc files
COPY etc /etc
# Symlink some external binaries, for convenience
RUN BINARIES=("distrobox" "flatpak" "podman" "rpm-ostree" "xdg-open" "notify-send", "wezterm"); \
for binary in "${BINARIES[@]}"; do \
ln -fs /usr/bin/distrobox-host-exec "/usr/local/bin/$binary"; \
done