fix: satiate hadolint
Build Container Image / build_latest_riscv64 (push) Successful in 57s Details
Build Container Image / build_latest_amd64 (push) Successful in 39s Details
Build Container Image / build_latest_i386 (push) Successful in 39s Details
Build Container Image / push_latest_amd64 (push) Successful in 1m51s Details
Build Container Image / push_latest_i386 (push) Successful in 1m46s Details
Build Container Image / push_latest_riscv64 (push) Successful in 1m54s Details
Build Container Image / build_latest_arm64 (push) Successful in 1m7s Details
Build Container Image / push_latest_arm64 (push) Successful in 1m40s Details
Build Container Image / push_latest (push) Successful in 4m35s Details
Build Container Image / update_readme (push) Successful in 10s Details
Build Container Image / build_latest (push) Successful in 1m44s Details

This commit is contained in:
Daniel Wolf 2024-03-31 19:31:00 -04:00
parent a338ccc34c
commit a22f8a4292
Signed by: nephatrine
GPG Key ID: 59D70EC2E4AAB4D0
1 changed files with 15 additions and 16 deletions

View File

@ -5,39 +5,38 @@
FROM code.nephatrine.net/nephnet/nxb-debian:llvm16
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
COPY override/usr/local/bin/freebsd-install /usr/local/bin/freebsd-install
ENV FREEBSD_VERSION=14.0 FREEBSD_PORTS_VERSION=14 FREEBSD_SYSROOT=/opt/freebsd/sysroot
RUN echo "====== INSTALL FREEBSD ======" \
&& export FREEBSD_DIST="$(uname -m)" && export FREEBSD_ARCH="$(uname -m)" \
&& if [ "$(uname -m)" = "x86_64" ]; then export FREEBSD_DIST="amd64" && export FREEBSD_ARCH="amd64"; fi \
&& if [ "$(uname -m)" = "i686" ]; then export FREEBSD_DIST="i386" && export FREEBSD_ARCH="i386"; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then export FREEBSD_DIST="arm64"; fi \
&& if [ "$(uname -m)" = "riscv64" ]; then export FREEBSD_DIST="riscv"; fi \
COPY override/usr/local/bin/freebsd-install /usr/local/bin/freebsd-install
WORKDIR /opt/freebsd/sysroot
RUN FREEBSD_DIST="$(uname -m)" && FREEBSD_ARCH="$(uname -m)" \
&& if [ "$(uname -m)" = "x86_64" ]; then FREEBSD_DIST="amd64" && FREEBSD_ARCH="amd64"; fi \
&& if [ "$(uname -m)" = "i686" ]; then FREEBSD_DIST="i386" && FREEBSD_ARCH="i386"; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then FREEBSD_DIST="arm64"; fi \
&& if [ "$(uname -m)" = "riscv64" ]; then FREEBSD_DIST="riscv"; fi \
&& export FREEBSD_ARCH && export FREEBSD_DIST \
&& wget --progress=dot:giga -O "${HOME}/freebsd.txz" "https://download.freebsd.org/ftp/releases/${FREEBSD_DIST}/${FREEBSD_ARCH}/${FREEBSD_VERSION}-RELEASE/base.txz" \
&& if [ "$(uname -m)" = "x86_64" ]; then wget --progress=dot:giga -O "${HOME}/freebsd32.txz" "https://download.freebsd.org/ftp/releases/${FREEBSD_DIST}/${FREEBSD_ARCH}/${FREEBSD_VERSION}-RELEASE/lib32.txz"; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then wget --progress=dot:giga -O "${HOME}/freebsd32.txz" "https://download.freebsd.org/ftp/releases/${FREEBSD_DIST}/${FREEBSD_ARCH}/${FREEBSD_VERSION}-RELEASE/lib32.txz"; fi \
&& mkdir -p "${FREEBSD_SYSROOT}" && cd "${FREEBSD_SYSROOT}" \
&& bsdtar -xf "${HOME}/freebsd.txz" \
&& if [ -e "${HOME}/freebsd32.txz" ]; then bsdtar -xf "${HOME}/freebsd32.txz"; fi \
&& mkdir "/usr/lib/clang/${LLVM_MAJOR}/lib/freebsd" \
&& cp -nrvs /opt/freebsd/sysroot/usr/lib/clang/${LLVM_MAJOR}*/lib/freebsd/. "/usr/lib/clang/${LLVM_MAJOR}/lib/freebsd/" \
&& cp -nrvs /opt/freebsd/sysroot/usr/lib/clang/"${LLVM_MAJOR}"*/lib/freebsd/. "/usr/lib/clang/${LLVM_MAJOR}/lib/freebsd/" \
&& freebsd-install \
&& cd "${HOME}" && rm -rf /tmp/* /var/tmp/* ./*.txz
&& rm -rf /tmp/* /var/tmp/* "${HOME}"/*.txz
RUN echo "====== INSTALL PACKAGES ======" \
&& if [ "$(uname -m)" = "x86_64" ]; then FREEBSD_ARCH="i386" freebsd-install archivers/zstd devel/icu ftp/curl security/openssl-devel textproc/libxml2; fi \
RUN if [ "$(uname -m)" = "x86_64" ]; then FREEBSD_ARCH="i386" freebsd-install archivers/zstd devel/icu ftp/curl security/openssl-devel textproc/libxml2; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then FREEBSD_ARCH="armv7" freebsd-install archivers/zstd devel/icu ftp/curl security/openssl-devel textproc/libxml2; fi \
&& if [ ! "$(uname -m)" = "riscv64" ]; then freebsd-install archivers/zstd devel/icu ftp/curl security/openssl-devel textproc/libxml2; fi \
&& rm -rf /tmp/* /var/tmp/*
COPY override /
RUN echo "====== TEST TOOLCHAINS ======" \
&& git -C "${HOME}" clone --single-branch --depth=1 https://code.nephatrine.net/nephatrine/hello-test.git \
# hadolint ignore=DL3003
RUN git -C "${HOME}" clone --single-branch --depth=1 https://code.nephatrine.net/nephatrine/hello-test.git \
&& mkdir "/tmp/build-$(uname -m)" && cd "/tmp/build-$(uname -m)" \
&& "nxbuild-freebsd-$(uname -m)" -GNinja "${HOME}/hello-test" \
&& ninja && file HelloTest \
&& if [ "$(uname -m)" = "x86_64" ]; then mkdir /tmp/build-i686 && cd /tmp/build-i686 \
&& nxbuild-freebsd-i686 -GNinja "${HOME}/hello-test" \
&& ninja && file HelloTest; fi \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* "${HOME}/hello-test"
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/hello-test"