Try and fix broken 32bit qemu builds on 64bit system

This patch adds a 'fix' for trying to build on armv7 32bit system
from a 64bit system.  qemu seems broken in this case.
This commit is contained in:
Hemna 2022-12-15 13:05:22 -05:00
parent 19e5cfa9cc
commit 87cbcaa47f
5 changed files with 25 additions and 2 deletions

View File

@ -56,6 +56,7 @@ jobs:
file: ./Dockerfile-dev
build-args: |
BRANCH=${{ steps.branch-name.outputs.current_branch }}
BUILDX_QEMU_ENV=true
push: true
tags: |
hemna6969/aprsd:${{ steps.branch-name.outputs.current_branch }}

View File

@ -39,10 +39,11 @@ jobs:
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:docker"
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm/v7
file: ./Dockerfile
build-args: |
VERSION=${{ inputs.aprsd_version }}
BUILDX_QEMU_ENV=true
push: true
tags: |
hemna6969/aprsd:v${{ inputs.aprsd_version }}

View File

@ -7,6 +7,7 @@ ARG UID
ARG GID
ARG TZ
ARG VERSION=2.6.0
ARG BUILDX_QEMU_ENV
ENV APRS_USER=aprs
ENV HOME=/home/aprs
ENV TZ=${TZ:-US/Eastern}
@ -26,6 +27,14 @@ RUN apt install -y python3 python3-pip python3-dev python3-lxml
RUN addgroup --gid $GID $APRS_USER
RUN useradd -m -u $UID -g $APRS_USER $APRS_USER
# Handle an extremely specific issue when building the cryptography package for
# 32-bit architectures within QEMU running on a 64-bit host (issue #30).
RUN if [ "${BUILDX_QEMU_ENV}" = "true" -a "$(getconf LONG_BIT)" = "32" ]; then \
pip3 install -U cryptography==3.3.2; \
else \
pip3 install cryptography ;\
fi
# Install aprsd
RUN pip install aprsd==$APRSD_PIP_VERSION

View File

@ -6,6 +6,8 @@ ARG BRANCH=master
ARG UID
ARG GID
ARG BUILDX_QEMU_ENV
ENV APRS_USER=aprs
ENV HOME=/home/aprs
ENV APRSD=http://github.com/craigerl/aprsd.git
@ -39,6 +41,13 @@ RUN cat $HOME/.bashrc
USER root
WORKDIR $HOME
# Handle an extremely specific issue when building the cryptography package for
# 32-bit architectures within QEMU running on a 64-bit host (issue #30).
RUN if [ "${BUILDX_QEMU_ENV}" = "true" -a "$(getconf LONG_BIT)" = "32" ]; then \
pip3 install -U cryptography==3.3.2; \
else \
pip3 install cryptography ;\
fi
RUN mkdir $INSTALL
RUN git clone -b $BRANCH $APRSD $INSTALL/aprsd
RUN cd $INSTALL/aprsd && pip3 install -v .

View File

@ -88,12 +88,15 @@ then
# Use this script to locally build the docker image
docker buildx build --push --platform $PLATFORMS \
-t harbor.hemna.com/hemna6969/aprsd:$TAG \
-f Dockerfile-dev --build-arg branch=$BRANCH --no-cache .
-f Dockerfile-dev --build-arg branch=$BRANCH \
--build-arg BUILDX_QEMU_ENV=true \
--no-cache .
else
# Use this script to locally build the docker image
echo "Build with tag=${TAG} BRANCH=${BRANCH} dev?=${DEV} platforms?=${PLATFORMS} VERSION=${VERSION}"
docker buildx build --push --platform $PLATFORMS \
--build-arg VERSION=$VERSION \
--build-arg BUILDX_QEMU_ENV=true \
-t hemna6969/aprsd:$VERSION \
-t hemna6969/aprsd:$TAG \
-t hemna6969/aprsd:latest \