builder-archlinux/Dockerfile

84 lines
3.7 KiB
Docker
Raw Permalink Normal View History

2024-03-21 14:26:46 -04:00
# SPDX-FileCopyrightText: 2023 - 2024 Daniel Wolf <nephatrine@gmail.com>
2023-10-20 12:00:07 -04:00
#
# SPDX-License-Identifier: ISC
2024-03-30 14:54:36 -04:00
# hadolint ignore=DL3007
2024-03-22 16:32:52 -04:00
FROM archlinux:latest
2023-04-25 17:32:17 -04:00
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
2024-03-30 14:54:36 -04:00
#RUN pacman -Sy --noconfirm --needed reflector \
# && reflector -l 200 -p https --sort rate --save /etc/pacman.d/mirrorlist.reflector \
# && mv /etc/pacman.d/mirrorlist.reflector /etc/pacman.d/mirrorlist \
# hadolint ignore=DL4006,SC2046
2024-03-30 14:54:36 -04:00
RUN pacman -Syu --noconfirm \
2023-04-25 17:32:17 -04:00
&& pacman-db-upgrade \
2024-03-21 14:26:46 -04:00
&& for file in $(find /etc -name '*.pacnew'); do mv -vf "${file}" "$(echo ${file} | sed 's/\.pacnew//g')"; done \
2023-04-25 17:32:17 -04:00
&& sed -i 's/^#en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen && locale-gen \
&& printf "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
&& pacman -Sy --noconfirm --needed \
bash bzip2 ca-certificates curl file gawk git git-lfs jq libarchive \
2024-03-21 18:30:15 -04:00
lsb-release make npm p7zip patch subversion sudo unzip wget which xz zip \
2024-03-30 14:54:36 -04:00
&& if [ -n "$(pacman -Qtdq)" ]; then pacman -Rns --noconfirm $(pacman -Qtdq); fi \
2024-03-21 14:26:46 -04:00
&& pacman -Scc --noconfirm \
&& useradd -u 1337 -g users -d /home/builder -s /bin/bash builder \
&& mkdir -p /home/builder \
&& chown -R builder:users /home/builder \
&& echo 'builder ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/builder \
&& rm -rf /tmp/* /var/tmp/*
# hadolint ignore=SC2046
2024-03-30 14:54:36 -04:00
RUN pacman -Sy --noconfirm --needed \
2024-03-26 10:44:15 -04:00
autoconf automake binutils bison clang cmake debugedit fakeroot flex gcc \
2024-03-21 14:26:46 -04:00
lib32-gcc-libs libtool nasm ninja pkgconf texinfo \
2023-04-25 17:32:17 -04:00
&& pacman -Sy --noconfirm --needed \
icu lib32-curl lib32-icu lib32-libxml2 lib32-openssl lib32-zlib lib32-zstd \
libxml2 openssl zlib zstd \
2024-03-30 14:54:36 -04:00
&& if [ -n "$(pacman -Qtdq)" ]; then pacman -Rns --noconfirm $(pacman -Qtdq); fi \
2024-03-21 14:26:46 -04:00
&& pacman -Scc --noconfirm \
&& rm -rf /tmp/* /var/tmp/*
ENV PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin
# hadolint ignore=DL3013,SC2046
2024-03-30 14:54:36 -04:00
RUN pacman -Sy --noconfirm --needed python-pipx reuse \
&& if [ -n "$(pacman -Qtdq)" ]; then pacman -Rns --noconfirm $(pacman -Qtdq); fi \
2023-04-25 17:32:17 -04:00
&& pacman -Scc --noconfirm \
2023-06-12 14:45:58 -04:00
&& pipx install cmakelang \
2023-04-25 17:32:17 -04:00
&& rm -rf /tmp/* /var/tmp/*
2024-03-21 14:26:46 -04:00
ENV CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOPATH=/go
# hadolint ignore=SC2046
2024-03-30 14:54:36 -04:00
RUN pacman -Sy --noconfirm --needed go \
&& if [ -n "$(pacman -Qtdq)" ]; then pacman -Rns --noconfirm $(pacman -Qtdq); fi \
2023-04-25 17:32:17 -04:00
&& pacman -Scc --noconfirm \
2024-03-21 14:26:46 -04:00
&& go install github.com/mdomke/git-semver/v6@latest \
&& rm -rf /tmp/* /var/tmp/*
ENV PATH ${GOPATH}/bin:$PATH
2023-04-25 17:32:17 -04:00
# hadolint ignore=SC2046
2024-03-30 14:54:36 -04:00
RUN pacman -Sy --noconfirm --needed \
2024-03-21 18:20:36 -04:00
doxygen graphviz imagemagick librsvg python-jinja python-pygments \
2024-03-21 14:26:46 -04:00
texlive-core \
2024-03-30 14:54:36 -04:00
&& if [ -n "$(pacman -Qtdq)" ]; then pacman -Rns --noconfirm $(pacman -Qtdq); fi \
2024-03-21 14:26:46 -04:00
&& pacman -Scc --noconfirm \
2024-03-30 14:54:36 -04:00
&& git -C "${HOME}" clone --single-branch --depth=1 https://github.com/mosra/m.css \
&& rm -rf "${HOME}"/m.css/documentation/test* \
2023-04-25 17:32:17 -04:00
&& mkdir /opt/m.css \
2024-03-30 14:54:36 -04:00
&& mv "${HOME}/m.css/documentation" /opt/m.css/bin && mv "${HOME}/m.css/COPYING" /opt/m.css/ \
&& mv "${HOME}/m.css/css" /opt/m.css/css && mv "${HOME}/m.css/plugins" /opt/m.css/plugins \
2024-03-21 14:26:46 -04:00
&& su - builder -c "git -C /tmp clone --single-branch --depth=1 https://aur.archlinux.org/mscgen.git" \
2024-03-30 14:54:36 -04:00
&& su - builder -c "cd /tmp/mscgen; makepkg --noconfirm --syncdeps --rmdeps --install --clean" \
&& rm -rf /tmp/* /var/tmp/* "${HOME}/m.css"
2023-04-25 17:32:17 -04:00
ENV PATH=/opt/m.css/bin:$PATH
COPY override /
2024-03-30 14:54:36 -04:00
# hadolint ignore=DL3003
RUN git -C "${HOME}" clone --single-branch --depth=1 https://code.nephatrine.net/nephatrine/hello-test.git \
2023-04-25 17:32:17 -04:00
&& mkdir /tmp/build-x86_64 && cd /tmp/build-x86_64 \
2024-03-21 14:26:46 -04:00
&& nxbuild-linux-x86_64 -GNinja "${HOME}/hello-test" \
2023-04-25 17:32:17 -04:00
&& ninja && ninja test \
&& mkdir /tmp/build-i686 && cd /tmp/build-i686 \
2024-03-21 14:26:46 -04:00
&& nxbuild-linux-i686 -GNinja "${HOME}/hello-test" \
2023-04-25 17:32:17 -04:00
&& ninja && ninja test \
2024-03-30 14:54:36 -04:00
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/hello-test"