Skip to content

docker: split up docker images for ffmpeg, gstreamer, and opencv #1

docker: split up docker images for ffmpeg, gstreamer, and opencv

docker: split up docker images for ffmpeg, gstreamer, and opencv #1

# This is the Github action to build and push the gocv/opencv Docker images.
#
name: Docker
on:
push:
branches: [build-opencv-alpine, alpine-static-improved]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
gstreamer:
name: gstreamer
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
gocv/gstreamer:1.24-alpine
ghcr.io/${{ github.repository_owner }}/gstreamer:1.24-alpine
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- 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
uses: docker/build-push-action@v6
with:
file: Dockerfile.gstreamer-static-alpine
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: |
gocv/gstreamer:1.24-alpine
ghcr.io/${{ github.repository_owner }}/gstreamer:1.24-alpine
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
ffmpeg:
name: ffmpeg
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
gocv/ffmpeg:5.16-alpine
ghcr.io/${{ github.repository_owner }}/ffmpeg:5.16-alpine
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- 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
uses: docker/build-push-action@v6
with:
file: Dockerfile.ffmpeg-static-alpine
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: |
gocv/ffmpeg:5.16-alpine
ghcr.io/${{ github.repository_owner }}/ffmpeg:5.16-alpine
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
opencv:
name: opencv
runs-on: ubuntu-latest
needs: [gstreamer, ffmpeg]
permissions:
packages: write
contents: read
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
gocv/opencv:4.10.0-alpine
ghcr.io/${{ github.repository_owner }}/opencv:4.10.0-alpine
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- 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
uses: docker/build-push-action@v6
with:
file: Dockerfile.opencv-static-alpine
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: |
gocv/opencv:4.10.0-alpine
ghcr.io/${{ github.repository_owner }}/opencv:4.10.0-alpine
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max