From 32d5cceae5c37d5e51741095e0fae897c17092fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Est=C3=A9vez?= Date: Wed, 10 Apr 2024 09:28:00 +0200 Subject: [PATCH] add cross-maia-sdr docker image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This image is needed to build a new version of maia-httpd that depends on pm-remez. Signed-off-by: Daniel Estévez --- .github/workflows/cross-maia-sdr.yml | 46 +++++++++++++++++++ README.md | 10 ++++ .../Dockerfile | 14 ++++++ 3 files changed, 70 insertions(+) create mode 100644 .github/workflows/cross-maia-sdr.yml create mode 100644 cross-armv7-unknown-linux-gnueabihf-maia-sdr/Dockerfile diff --git a/.github/workflows/cross-maia-sdr.yml b/.github/workflows/cross-maia-sdr.yml new file mode 100644 index 0000000..3f1e83e --- /dev/null +++ b/.github/workflows/cross-maia-sdr.yml @@ -0,0 +1,46 @@ +name: Build and publish cross-maia-sdr Docker image + +on: + push: + branches: ['test-cross-maia-sdr'] + tags: + - cross-maia-sdr-** + +env: + REGISTRY: ghcr.io + IMAGE_NAME: cross-armv7-unknown-linux-gnueabihf-maia-sdr + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=match,pattern=cross-maia-sdr-(\d+),group=1 + type=ref,event=branch + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ${{ env.IMAGE_NAME }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index d7e3fd4..e12edf2 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,16 @@ docker exec -u 0 -it maia-sdr-devel /bin/bash From this session, it is possible to run the Vivado installer and choose `/opt/Xilinx` as the installation path. +## cross-armv7-unknown-linux-gnueabihf-maia-sdr + +[ghcr.io/maia-sdr/cross-armv7-unknown-linux-gnueabihf-maia-sdr](https://github.com/orgs/maia-sdr/packages/container/package/cross-armv7-unknown-linux-gnueabihf-maia-sdr) +can be used to build +[maia-httpd](https://github.com/maia-sdr/maia-sdr/tree/main/maia-httpd) with +[cross](https://github.com/cross-rs/cross). In addition to the usual cross +stable Docker image, it contains some packages required to build +[pm-remez](https://github.com/maia-sdr/pm-remez), including the Fortran +cross-compiler. + ## cross-armv7-buildroot-linux-uclibc-gnueabihf [ghcr.io/maia-sdr/cross-armv7-buildroot-linux-uclibc-gnueabihf](https://github.com/orgs/maia-sdr/packages/container/package/cross-armv7-buildroot-linux-uclibc-gnueabihf) is used to build diff --git a/cross-armv7-unknown-linux-gnueabihf-maia-sdr/Dockerfile b/cross-armv7-unknown-linux-gnueabihf-maia-sdr/Dockerfile new file mode 100644 index 0000000..4ecb0ce --- /dev/null +++ b/cross-armv7-unknown-linux-gnueabihf-maia-sdr/Dockerfile @@ -0,0 +1,14 @@ +FROM ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:0.2.5 +ARG DEBIAN_FRONTEND=noninteractive + +# Set up env variables to cross-compile openblas and install packages required +# to build pm-remez + +ENV OPENBLAS_TARGET=armv7 +ENV OPENBLAS_HOSTCC=gcc +ENV OPENBLAS_CC=arm-linux-gnueabihf-gcc +ENV OPENBLAS_FC=arm-linux-gnueabihf-gfortran + +RUN apt-get update && \ + apt-get -y install pkg-config libssl-dev gfortran-arm-linux-gnueabihf && \ + rm -rf /var/lib/apt/lists/*