refactor: rewrite ci workflows
Build Container Image / build_latest_amd64 (push) Successful in 3m14s Details
Build Container Image / build_latest_i386 (push) Successful in 2m47s Details
Build Container Image / push_latest_amd64 (push) Successful in 1m28s Details
Build Container Image / push_latest_i386 (push) Successful in 1m13s Details
Build Container Image / build_latest_arm64 (push) Successful in 11m19s Details
Build Container Image / push_latest_arm64 (push) Successful in 1m22s Details
Build Container Image / build_latest_riscv64 (push) Successful in 27m19s Details
Build Container Image / push_latest_riscv64 (push) Successful in 1m26s Details
Build Container Image / push_latest (push) Successful in 3m11s Details
Build Container Image / update_readme (push) Successful in 9s Details
Build Container Image / build_latest (push) Successful in 45s Details

This commit is contained in:
Daniel Wolf 2024-03-26 19:27:06 -04:00
parent c66314123e
commit 872e09d409
Signed by: nephatrine
GPG Key ID: 59D70EC2E4AAB4D0
3 changed files with 192 additions and 68 deletions

View File

@ -9,9 +9,10 @@ on:
schedule:
- cron: '20 20 * * 3'
jobs:
build_amd64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
build_latest_amd64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
@ -24,6 +25,11 @@ jobs:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
@ -33,24 +39,44 @@ jobs:
provenance: false
pull: true
push: true
tags: code.nephatrine.net/nephnet/nxb-cross-freebsd:latest-amd64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-cache:latest-amd64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-cache:latest-amd64,mode=max
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-freebsd-amd64:latest
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-amd64:latest-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-amd64:latest-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-freebsd:${BRANCH}-latest-amd64 --platform linux/amd64 ${{ gitea.workspace }}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-freebsd:${BRANCH}-latest-amd64 --platform linux/amd64 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
with:
title: "Container Build (X86_64)"
title: "Container Build (X86_64; 14.0)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_i386:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
push_latest_amd64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_latest_amd64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-freebsd-amd64:latest --platform linux/amd64
docker tag code.nephatrine.net/nephnet/nxb-cross-freebsd-amd64:latest nephatrine/amd64:nxb-cross-freebsd-latest
docker rmi code.nephatrine.net/nephnet/nxb-cross-freebsd-amd64:latest
docker push nephatrine/amd64:nxb-cross-freebsd-latest
docker rmi nephatrine/amd64:nxb-cross-freebsd-latest
build_latest_i386:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-i386
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
@ -63,6 +89,11 @@ jobs:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
@ -72,24 +103,44 @@ jobs:
provenance: false
pull: true
push: true
tags: code.nephatrine.net/nephnet/nxb-cross-freebsd:latest-i386
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-cache:latest-i386
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-cache:latest-i386,mode=max
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-freebsd-i386:latest
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-i386:latest-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-i386:latest-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-freebsd:${BRANCH}-latest-i386 --platform linux/386 ${{ gitea.workspace }}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-freebsd:${BRANCH}-latest-i386 --platform linux/386 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
if: failure()
with:
title: "Container Build (I686)"
title: "Container Build (I686; 14.0)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_arm64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
push_latest_i386:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_latest_i386]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-freebsd-i386:latest --platform linux/386
docker tag code.nephatrine.net/nephnet/nxb-cross-freebsd-i386:latest nephatrine/ia32:nxb-cross-freebsd-latest
docker rmi code.nephatrine.net/nephnet/nxb-cross-freebsd-i386:latest
docker push nephatrine/ia32:nxb-cross-freebsd-latest
docker rmi nephatrine/ia32:nxb-cross-freebsd-latest
build_latest_arm64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-arm64
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
@ -102,6 +153,11 @@ jobs:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
@ -111,24 +167,44 @@ jobs:
provenance: false
pull: true
push: true
tags: code.nephatrine.net/nephnet/nxb-cross-freebsd:latest-arm64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-cache:latest-arm64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-cache:latest-arm64,mode=max
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-freebsd-arm64:latest
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-arm64:latest-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-arm64:latest-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-freebsd:${BRANCH}-latest-arm64 --platform linux/arm64/v8 ${{ gitea.workspace }}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-freebsd:${BRANCH}-latest-arm64 --platform linux/arm64/v8 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
if: failure()
with:
title: "Container Build (AARCH64)"
title: "Container Build (AARCH64; 14.0)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_riscv64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
push_latest_arm64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_latest_arm64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-freebsd-arm64:latest --platform linux/arm64/v8
docker tag code.nephatrine.net/nephnet/nxb-cross-freebsd-arm64:latest nephatrine/arm64:nxb-cross-freebsd-latest
docker rmi code.nephatrine.net/nephnet/nxb-cross-freebsd-arm64:latest
docker push nephatrine/arm64:nxb-cross-freebsd-latest
docker rmi nephatrine/arm64:nxb-cross-freebsd-latest
build_latest_riscv64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-riscv64
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
@ -141,6 +217,11 @@ jobs:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
@ -150,58 +231,100 @@ jobs:
provenance: false
pull: true
push: true
tags: code.nephatrine.net/nephnet/nxb-cross-freebsd:latest-riscv64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-cache:latest-riscv64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-cache:latest-riscv64,mode=max
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-freebsd-riscv64:latest
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-riscv64:latest-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-freebsd-riscv64:latest-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-freebsd:${BRANCH}-latest-riscv64 --platform linux/riscv64 ${{ gitea.workspace }}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-freebsd:${BRANCH}-latest-riscv64 --platform linux/riscv64 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
if: failure()
with:
title: "Container Build (RISCV64)"
title: "Container Build (RISCV64; 14.0)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_manifest:
push_latest_riscv64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_amd64, build_i386, build_arm64, build_riscv64]
needs: [build_latest_riscv64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Check Base Image
if: gitea.event_name == 'schedule'
uses: https://github.com/lucacome/docker-image-update-checker@v1
id: checkbase
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
base-image: nephatrine/nxbuilder:llvm16-stable
image: nephatrine/nxbuilder:cross-freebsd-14.0
platforms: linux/amd64
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-freebsd-riscv64:latest --platform linux/riscv64
docker tag code.nephatrine.net/nephnet/nxb-cross-freebsd-riscv64:latest nephatrine/riscv64:nxb-cross-freebsd-latest
docker rmi code.nephatrine.net/nephnet/nxb-cross-freebsd-riscv64:latest
docker push nephatrine/riscv64:nxb-cross-freebsd-latest
docker rmi nephatrine/riscv64:nxb-cross-freebsd-latest
build_latest:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_latest_amd64, build_latest_i386, build_latest_arm64, build_latest_riscv64]
runs-on: nephnet
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Manifest
run: |
docker manifest create code.nephatrine.net/nephnet/nxb-cross-freebsd:latest --amend code.nephatrine.net/nephnet/nxb-cross-freebsd-amd64:latest --amend code.nephatrine.net/nephnet/nxb-cross-freebsd-i386:latest --amend code.nephatrine.net/nephnet/nxb-cross-freebsd-arm64:latest --amend code.nephatrine.net/nephnet/nxb-cross-freebsd-riscv64:latest
docker manifest create code.nephatrine.net/nephnet/nxb-cross-freebsd:14.0 --amend code.nephatrine.net/nephnet/nxb-cross-freebsd-amd64:latest --amend code.nephatrine.net/nephnet/nxb-cross-freebsd-i386:latest --amend code.nephatrine.net/nephnet/nxb-cross-freebsd-arm64:latest --amend code.nephatrine.net/nephnet/nxb-cross-freebsd-riscv64:latest
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-freebsd:latest
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-freebsd:14.0
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Publish (14.0)"
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
push_latest:
needs: [push_latest_amd64, push_latest_i386, push_latest_arm64, push_latest_riscv64]
runs-on: nephnet
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker Manifest
run: docker buildx imagetools create -t code.nephatrine.net/nephnet/nxb-cross-freebsd:latest -t nephatrine/nxbuilder:cross-freebsd-14.0 -t nephatrine/nxbuilder:cross-freebsd-14 -t nephatrine/nxbuilder:cross-freebsd code.nephatrine.net/nephnet/nxb-cross-freebsd:latest-amd64 code.nephatrine.net/nephnet/nxb-cross-freebsd:latest-i386 code.nephatrine.net/nephnet/nxb-cross-freebsd:latest-arm64 code.nephatrine.net/nephnet/nxb-cross-freebsd:latest-riscv64
run: |
docker manifest create nephatrine/nxbuilder:debian-cross-freebsd --amend nephatrine/amd64:nxb-cross-freebsd-latest --amend nephatrine/ia32:nxb-cross-freebsd-latest --amend nephatrine/arm64:nxb-cross-freebsd-latest --amend nephatrine/riscv64:nxb-cross-freebsd-latest
docker manifest create nephatrine/nxb-cross-freebsd:latest --amend nephatrine/amd64:nxb-cross-freebsd-latest --amend nephatrine/ia32:nxb-cross-freebsd-latest --amend nephatrine/arm64:nxb-cross-freebsd-latest --amend nephatrine/riscv64:nxb-cross-freebsd-latest
docker manifest create nephatrine/nxb-cross-freebsd:14.0 --amend nephatrine/amd64:nxb-cross-freebsd-latest --amend nephatrine/ia32:nxb-cross-freebsd-latest --amend nephatrine/arm64:nxb-cross-freebsd-latest --amend nephatrine/riscv64:nxb-cross-freebsd-latest
docker manifest push --purge nephatrine/nxbuilder:debian-cross-freebsd
docker manifest push --purge nephatrine/nxb-cross-freebsd:latest
docker manifest push --purge nephatrine/nxb-cross-freebsd:14.0
- name: Notify Discord
if: gitea.event_name != 'schedule' || steps.checkbase.outputs.needs-updating == 'true'
if: gitea.event_name != 'schedule'
uses: https://github.com/sarisia/actions-status-discord@v1
with:
title: "DockerHub: nxb-cross-freebsd"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/nxbuilder/general).\nPull `nephatrine/nxbuilder:cross-freebsd-14.0` for the newest image."
title: "DockerHub: nxb-cross-freebsd (14.0)"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/nxb-cross-freebsd/general).\nPull `nephatrine/nxb-cross-freebsd:14.0` for the newest image."
nodetail: true
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
update_readme:
needs: [push_latest]
runs-on: nephnet
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: Docker Describe
uses: https://github.com/peter-evans/dockerhub-description@v3
with:
title: "Container Publish"
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
repository: nephatrine/nxb-cross-freebsd

View File

@ -2,28 +2,28 @@
#
# SPDX-License-Identifier: ISC
FROM code.nephatrine.net/nephnet/nxb-debian:llvm16-internal
FROM code.nephatrine.net/nephnet/nxb-debian:internal-llvm16
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
ENV FREEBSD_VERSION=14.0 FREEBSD_PORTS_VERSION=14 FREEBSD_SYSROOT=/opt/freebsd/sysroot
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 \
&& wget -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 -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 -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/ \
&& 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/" \
&& freebsd-install \
&& rm -rf /tmp/* /var/tmp/* ${HOME}/*.txz
&& cd "${HOME}" && rm -rf /tmp/* /var/tmp/* ./*.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 \
@ -33,11 +33,11 @@ RUN echo "====== INSTALL PACKAGES ======" \
COPY override /
RUN echo "====== TEST TOOLCHAINS ======" \
&& 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 \
&& 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 \
&& nxbuild-freebsd-i686 -GNinja "${HOME}/hello-test" \
&& ninja && file HelloTest; fi \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/hello-test
&& cd /tmp && rm -rf /tmp/* /var/tmp/* "${HOME}/hello-test"

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: ISC
-->
[Git](https://code.nephatrine.net/NephNET/builder-cross-freebsd/src/branch/master) |
[Docker](https://hub.docker.com/r/nephatrine/nxbuilder/)
[Docker](https://hub.docker.com/r/nephatrine/nxb-cross-freebsd/)
# NXBuilder
@ -21,6 +21,7 @@ beyond that. It can also be used as a quick "cleanroom" to test builds in.
- [Clang](https://clang.llvm.org/)
- [GCC](https://gcc.gnu.org/)
- [Go](https://go.dev/)
### Cross-Compilers
@ -38,5 +39,5 @@ beyond that. It can also be used as a quick "cleanroom" to test builds in.
You can spin up a quick temporary test container like this:
~~~
docker run --rm -ti nephatrine/nxbuilder:cross-freebsd-14.0 /bin/bash
docker run --rm -ti nephatrine/nxb-cross-freebsd:latest /bin/bash
~~~