From 3a1f5959447c8af614428d34c87f108857677779 Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Fri, 20 Jan 2023 13:30:52 +0100 Subject: [PATCH] fix for static build armv7 + rename --- .github/workflows/amd64.yaml | 2 +- .github/workflows/arm64.yaml | 2 +- .github/workflows/armv5.yaml | 2 +- .github/workflows/armv6.yaml | 2 +- .github/workflows/armv7.yaml | 4 +-- Dockerfile-armv7 | 52 ++++++++++++++++++++++++++++++++++++ 6 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 Dockerfile-armv7 diff --git a/.github/workflows/amd64.yaml b/.github/workflows/amd64.yaml index ea2e4bc..8c03568 100644 --- a/.github/workflows/amd64.yaml +++ b/.github/workflows/amd64.yaml @@ -1,4 +1,4 @@ -name: Docker amd64 +name: AMD64 on: push: diff --git a/.github/workflows/arm64.yaml b/.github/workflows/arm64.yaml index 0523eb0..d3b8301 100644 --- a/.github/workflows/arm64.yaml +++ b/.github/workflows/arm64.yaml @@ -1,4 +1,4 @@ -name: Docker arm64 +name: ARM64 on: push: diff --git a/.github/workflows/armv5.yaml b/.github/workflows/armv5.yaml index d194209..7206481 100644 --- a/.github/workflows/armv5.yaml +++ b/.github/workflows/armv5.yaml @@ -1,4 +1,4 @@ -name: Docker armv5 +name: ARMv5 on: push: diff --git a/.github/workflows/armv6.yaml b/.github/workflows/armv6.yaml index d06b37e..bf7ac03 100644 --- a/.github/workflows/armv6.yaml +++ b/.github/workflows/armv6.yaml @@ -1,4 +1,4 @@ -name: Docker armv6 +name: ARMv6 on: push: diff --git a/.github/workflows/armv7.yaml b/.github/workflows/armv7.yaml index 11adf01..35ca0b5 100644 --- a/.github/workflows/armv7.yaml +++ b/.github/workflows/armv7.yaml @@ -1,4 +1,4 @@ -name: Docker armv7 +name: ARMv7 on: push: @@ -24,6 +24,6 @@ jobs: - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} - name: Run Buildx - run: docker buildx build --platform linux/arm/v7 -t kerberos/base:armv7-$(echo $GITHUB_SHA | cut -c1-7) --push . + run: docker buildx build --platform linux/arm/v7 -t kerberos/base:armv7-$(echo $GITHUB_SHA | cut -c1-7) -f Dockerfile-armv7 --push . - name: Append manifest run: docker buildx imagetools create --append -t kerberos/base:$(echo $GITHUB_SHA | cut -c1-7) kerberos/base:armv7-$(echo $GITHUB_SHA | cut -c1-7) \ No newline at end of file diff --git a/Dockerfile-armv7 b/Dockerfile-armv7 new file mode 100644 index 0000000..0cb1a2f --- /dev/null +++ b/Dockerfile-armv7 @@ -0,0 +1,52 @@ +FROM balenalib/raspberrypi3-golang AS builder + +LABEL Author=Kerberos.io + +RUN apt-get update && apt-get upgrade -y && apt-get install -y wget build-essential \ + cmake libc-ares-dev uuid-dev daemon libwebsockets-dev git \ + cmake wget dh-autoreconf autotools-dev autoconf automake gcc \ + build-essential libtool make ca-certificates nasm tar unzip wget pkg-config + +############################# +# Static build x264 + +RUN git clone https://code.videolan.org/videolan/x264.git && \ + cd x264 && git checkout 0a84d986 && \ + ./configure --prefix=/usr/local --enable-static --enable-pic && \ + make -j8 && \ + make install && \ + cd .. && rm -rf x264 + +################################# +# Clone and build FFMpeg & OpenCV + +RUN git clone https://github.com/FFmpeg/FFmpeg && \ + cd FFmpeg && git checkout n4.4.1 && \ + ./configure --prefix=/usr/local --target-os=linux --enable-nonfree \ + --extra-ldflags="-latomic" \ + --enable-avfilter \ + --disable-zlib \ + --enable-avresample \ + --enable-gpl \ + --extra-libs=-latomic \ + --enable-static --disable-shared && \ + make -j8 && \ + make install && \ + cd .. && rm -rf FFmpeg + +RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/4.7.0.zip && \ + unzip opencv.zip && mv opencv-4.7.0 opencv && cd opencv && mkdir build && cd build && \ + cmake -D CMAKE_BUILD_TYPE=RELEASE \ + -D CMAKE_INSTALL_PREFIX=/usr/ \ + -D OPENCV_GENERATE_PKGCONFIG=YES \ + -D BUILD_SHARED_LIBS=OFF \ + -D BUILD_TESTS=OFF \ + -D OPENCV_ENABLE_NONFREE=ON \ + #-D BUILD_opencv_dnn=OFF \ + -D BUILD_opencv_ml=OFF \ + -D BUILD_opencv_stitching=OFF \ + -D BUILD_opencv_ts=OFF \ + -D BUILD_opencv_java_bindings_generator=OFF \ + -D BUILD_opencv_python_bindings_generator=OFF \ + -D INSTALL_PYTHON_EXAMPLES=OFF \ + -D BUILD_EXAMPLES=OFF .. && make -j8 && make install && cd ../.. && rm -rf opencv* \ No newline at end of file