1
0
Fork 0

Add Containerfile

master
Dustin 2023-12-02 13:41:22 -06:00
parent 082a5fa4f9
commit 123d8c8630
2 changed files with 81 additions and 0 deletions

5
.containerignore Normal file
View File

@ -0,0 +1,5 @@
*
!.git
!pinentry-stub.sh
!pyproject.toml
!xactfetch.py

76
Containerfile Normal file
View File

@ -0,0 +1,76 @@
FROM registry.fedoraproject.org/fedora-minimal:38 AS build
RUN --mount=type=cache,target=/var/cache \
microdnf install -y \
--setopt install_weak_deps=0 \
rust \
cargo \
&& :
RUN cargo install rbw
RUN --mount=type=cache,target=/var/cache \
microdnf install -y \
--setopt install_weak_deps=0 \
git-core \
python3-devel \
python3-pip \
python3-wheel \
&& :
COPY . /src
RUN python3 -m pip wheel -w /wheels /src
FROM registry.fedoraproject.org/fedora-minimal:38
RUN --mount=type=cache,target=/var/cache \
microdnf install -y \
--setopt install_weak_deps=0 \
alsa-lib \
atk \
cairo \
cairo-gobject \
dbus-glib \
fontconfig \
freetype \
gdk-pixbuf2 \
gtk3 \
libX11 \
libX11-xcb \
libXcomposite \
libXcursor \
libXdamage \
libXext \
libXfixes \
libXi \
libXrandr \
libXrender \
libXtst \
libxcb \
pango \
python3 \
python3-pip \
tini \
&& echo xactfetch:x:2468: >> /etc/group \
&& echo xactfetch:*:2468:2468:xactfetch:/var/lib/xactfetch:/sbin/nologin >> /etc/passwd \
&& :
ENV PLAYWRIGHT_BROWSERS_PATH=/usr/local/playwright/browsers
RUN --mount=type=bind,from=build,source=/,target=/build \
python3 -m pip install --no-index -f /build/wheels xactfetch \
&& cp /build/root/.cargo/bin/rbw* /usr/local/bin/ \
&& install /build/src/pinentry-stub.sh /usr/local/bin/pinentry-stub \
&& playwright install firefox \
&& :
VOLUME /var/lib/xactfetch
WORKDIR /var/lib/xactfetch
USER 2468:2468
ENV XDG_CONFIG_HOME=/etc
ENTRYPOINT ["tini", "xactfetch", "--"]