mirror of
https://github.com/kerberos-io/golang-ffmpeg-opencv.git
synced 2025-12-24 13:57:55 +08:00
init repo
This commit is contained in:
29
.github/workflows/amd64.yaml
vendored
Normal file
29
.github/workflows/amd64.yaml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Docker amd64
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v3
|
||||
with:
|
||||
buildx-version: latest
|
||||
qemu-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Run Buildx
|
||||
run: docker buildx build --platform linux/amd64 -t kerberos/golang-ffmpeg-opencv:amd64-$(echo $GITHUB_SHA | cut -c1-7) --push .
|
||||
- name: Create new and append to manifest
|
||||
run: docker buildx imagetools create -t kerberos/golang-ffmpeg-opencv:$(echo $GITHUB_SHA | cut -c1-7) kerberos/golang-ffmpeg-opencv:amd64-$(echo $GITHUB_SHA | cut -c1-7)
|
||||
29
.github/workflows/arm64.yaml
vendored
Normal file
29
.github/workflows/arm64.yaml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Docker arm64
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v3
|
||||
with:
|
||||
buildx-version: latest
|
||||
qemu-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Run Buildx
|
||||
run: docker buildx build --platform linux/arm64 -t kerberos/golang-ffmpeg-opencv:arm64-$(echo $GITHUB_SHA | cut -c1-7) --push .
|
||||
- name: Append manifest
|
||||
run: docker buildx imagetools create --append -t kerberos/golang-ffmpeg-opencv:$(echo $GITHUB_SHA | cut -c1-7) kerberos/golang-ffmpeg-opencv:arm64-$(echo $GITHUB_SHA | cut -c1-7)
|
||||
29
.github/workflows/armv7.yaml
vendored
Normal file
29
.github/workflows/armv7.yaml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Docker armv7
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v3
|
||||
with:
|
||||
buildx-version: latest
|
||||
qemu-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Run Buildx
|
||||
run: docker buildx build --platform linux/arm/v7 -t kerberos/golang-ffmpeg-opencv:armv7-$(echo $GITHUB_SHA | cut -c1-7) --push .
|
||||
- name: Append manifest
|
||||
run: docker buildx imagetools create --append -t kerberos/golang-ffmpeg-opencv:$(echo $GITHUB_SHA | cut -c1-7) kerberos/golang-ffmpeg-opencv:armv7-$(echo $GITHUB_SHA | cut -c1-7)
|
||||
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM golang:1.18.0-stretch AS builder
|
||||
|
||||
ARG gitlab_id
|
||||
ARG gitlab_token
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Compile FFMPEG + x264
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get -y --no-install-recommends install git cmake wget dh-autoreconf autotools-dev autoconf automake gcc build-essential libtool make ca-certificates supervisor nasm zlib1g-dev tar libx264. unzip wget pkg-config libavresample-dev && \
|
||||
git clone https://github.com/FFmpeg/FFmpeg && \
|
||||
cd FFmpeg && git checkout remotes/origin/release/4.0 && \
|
||||
./configure --prefix=/usr/local --target-os=linux --enable-nonfree --enable-libx264 --enable-gpl --enable-shared && \
|
||||
make -j8 && \
|
||||
make install && \
|
||||
cd .. && rm -rf FFmpeg
|
||||
RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/4.0.0.zip && \
|
||||
unzip opencv.zip && mv opencv-4.0.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_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*
|
||||
Reference in New Issue
Block a user