arch-packaging-container/Containerfile

48 lines
2.1 KiB
Text
Raw Permalink Normal View History

2024-10-22 12:01:07 -04:00
# Arch Packaging Container - An isolated environment for building Arch Linux packages.
# Copyright (C) 2024 Foster Hangdaan
2024-10-22 09:59:28 -04:00
#
2024-10-22 12:01:07 -04:00
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
2024-10-22 09:59:28 -04:00
#
2024-10-22 12:01:07 -04:00
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
2024-10-22 09:59:28 -04:00
#
2024-10-22 12:01:07 -04:00
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2024-10-22 09:59:28 -04:00
FROM docker.io/library/archlinux:base-devel
2024-10-22 12:04:32 -04:00
LABEL org.opencontainers.image.title="Arch Packaging Container"
LABEL org.opencontainers.image.description="An isolated environment for building Arch Linux packages."
LABEL org.opencontainers.image.authors="Foster Hangdaan <foster@hangdaan.email>"
LABEL org.opencontainers.image.url="https://code.fosterhangdaan.com/foster/arch-packaging-container/src/branch/trunk/README.org"
LABEL org.opencontainers.image.documentation="https://code.fosterhangdaan.com/foster/arch-packaging-container/wiki"
LABEL org.opencontainers.image.source="https://code.fosterhangdaan.com/foster/arch-packaging-container"
LABEL org.opencontainers.image.licenses="GPL-3.0-or-later"
2024-10-22 09:59:28 -04:00
RUN set -ex && \
pacman -Sy && \
2024-10-22 09:59:28 -04:00
useradd --create-home builder && \
echo "builder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder && \
echo "BUILDDIR=/build/app/" >> /home/builder/.makepkg.conf && \
echo "PKGDEST=/build/packages/" >> /home/builder/.makepkg.conf && \
echo "SRCDEST=/build/sources/" >> /home/builder/.makepkg.conf && \
echo "SRCPKGDEST=/build/srcpackages/" >> /home/builder/.makepkg.conf && \
echo "LOGDEST=/build/logs/" >> /home/builder/.makepkg.conf && \
mkdir -p /pkg /build && \
2024-10-29 06:12:43 -04:00
chown -R builder:builder /build
2024-10-22 09:59:28 -04:00
USER builder
WORKDIR /pkg
VOLUME ["/pkg", "/build"]
ENTRYPOINT ["/usr/bin/makepkg"]
CMD ["--syncdeps", "--noconfirm"]