Skip to content

Commit

Permalink
build: fix Dockerfile for raspi/arm32v7
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Jun 13, 2023
1 parent 272b16e commit 836d317
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ RUN [ "$BUILD_TYPE" != "raspi" ] || \
echo "deb http://archive.raspberrypi.org/debian/ $DEBIAN_VERSION main" > /etc/apt/sources.list.d/raspi.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E 82B129927FA3303E && \
apt-get -y update && \
apt-get -y install libcamera-dev liblivemedia-dev \
apt-get -y install libcamera-dev liblivemedia-dev && \
# Temporary workaround to RPI arm32 bug
( [ "$(dpkg --print-architecture)" != "armhf" ] || apt-get --allow-downgrades -y install libssl1.1=1.1.1n-0+deb11u4+rpt1 ) \
)

# Default packages
Expand Down
13 changes: 8 additions & 5 deletions .github/ci/build-env
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#!/bin/bash

if [[ $# -gt 2 ]]; then
echo "usage: $0 <buster|bullseye> <amd64|arm32v7|arm64v8>"
if [[ $# -lt 3 ]]; then
echo "usage: $0 <generic|raspi> <buster|bullseye> <amd64|arm32v7|arm64v8>"
exit 1
fi

docker_image="camera_streamer_build_env"

build_type="raspi"
[[ -n "$1" ]] && build_type="$1"

debian_version="bullseye"
[[ -n "$1" ]] && debian_version="$1" && docker_image="${docker_image}_${1}"
[[ -n "$2" ]] && debian_version="$2" && docker_image="${docker_image}_${2}"

docker_arch=""
[[ -n "$2" ]] && docker_arch="$2/" && docker_image="${docker_image}_${2}"
[[ -n "$3" ]] && docker_arch="$3/" && docker_image="${docker_image}_${3}"

PWD=$(pwd)
ROOT=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/../.." &> /dev/null && pwd)
Expand All @@ -21,7 +24,7 @@ set -xeo pipefail
docker build -t "$docker_image" \
--build-arg "DOCKER_ARCH=$docker_arch" \
--build-arg "DEBIAN_VERSION=$debian_version" \
--build-arg BUILD_TYPE \
--build-arg "BUILD_TYPE=$build_type" \
--target build_env - < .github/ci/Dockerfile

exec docker run --rm -it -u "$UID" -v "$ROOT:$ROOT" -w "$ROOT" "$docker_image"

0 comments on commit 836d317

Please sign in to comment.