-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use latest opencv on ubuntu (#2437)
* fix: use latest opencv on ubuntu * feat: add using opencv dockerfile * trigger event * remove test trigger * use builded container * rebuild image * update build image * debug * swithc to root * fix install dep * fix source * fix dependency * fix dependency * fix: dependency * build new image version * fix source * fix: build errors * fix: install dep * fix: dependency * fix: dependency * fix dependency * fix: remove sudo command * fix dependency in doc * fix: update opencv version * fix: update opencv * fix: decrease repetition * try to use action * use fixed version * fix version format
- Loading branch information
Showing
11 changed files
with
275 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Install Android Dependencies' | ||
description: 'Sets up JDK and Android SDK/NDK' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK environment | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17 | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
with: | ||
cmdline-tools-version: 12266719 | ||
|
||
- name: Install NDK | ||
shell: bash | ||
run: echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/16.0/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build OpenCV Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- 'docker/opencv.Dockerfile' | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: docker/opencv.Dockerfile | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}/opencv-builder:latest | ||
ghcr.io/${{ github.repository }}/opencv-builder:4.11.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM ghcr.io/catthehacker/ubuntu:rust-22.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libjpeg-dev \ | ||
libtiff-dev \ | ||
libpng-dev \ | ||
libavcodec-dev \ | ||
libavformat-dev \ | ||
libswscale-dev \ | ||
libv4l-dev \ | ||
libxvidcore-dev \ | ||
libx264-dev \ | ||
libgtk-3-dev \ | ||
libatlas-base-dev \ | ||
gfortran \ | ||
python3-dev \ | ||
unzip \ | ||
wget \ | ||
cmake \ | ||
g++ | ||
|
||
WORKDIR /tmp | ||
|
||
RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/4.11.0.zip && \ | ||
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.11.0.zip && \ | ||
unzip opencv.zip && \ | ||
unzip opencv_contrib.zip && \ | ||
cd opencv-4.11.0 && \ | ||
mkdir build && cd build && \ | ||
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | ||
-D CMAKE_INSTALL_PREFIX=/usr/local \ | ||
-D OPENCV_ENABLE_NONFREE=ON \ | ||
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.11.0/modules \ | ||
-D BUILD_EXAMPLES=OFF .. && \ | ||
make -j2 && \ | ||
make install && \ | ||
ldconfig && \ | ||
cd /tmp && \ | ||
rm -rf opencv* && \ | ||
apt-get clean | ||
|
||
WORKDIR /build |
Oops, something went wrong.