Skip to content

Commit

Permalink
build: docker images with opencv
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Mar 13, 2023
1 parent d26ae19 commit 0fd8d4e
Showing 1 changed file with 277 additions and 0 deletions.
277 changes: 277 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
# This is the Github action to build and push the gocv/opencv Docker images.
#
name: Docker
on:
push:
branches: [ build-opencv-images ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
opencv:
name: opencv
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gocv/opencv
ghcr.io/${{ github.repository }}/opencv
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: Dockerfile.opencv
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: gocv/opencv:4.7.0-dev
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

opencv-gpu-cuda-10:
name: opencv-gpu-cuda-10
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gocv/opencv
ghcr.io/${{ github.repository }}/opencv
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: Dockerfile.opencv-gpu-cuda-10
platforms: linux/amd64
context: .
push: true
tags: gocv/opencv:4.7.0-gpu-cuda-10-dev
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

opencv-gpu-cuda-11:
name: opencv-gpu-cuda-11
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gocv/opencv
ghcr.io/${{ github.repository }}/opencv
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: Dockerfile.opencv-gpu-cuda-11
platforms: linux/amd64
context: .
push: true
tags: gocv/opencv:4.7.0-gpu-cuda-11-dev
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

opencv-gpu-cuda-11-2-2:
name: opencv-gpu-cuda-11-2-2
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gocv/opencv
ghcr.io/${{ github.repository }}/opencv
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: Dockerfile.opencv-gpu-cuda-11.2.2
platforms: linux/amd64
context: .
push: true
tags: gocv/opencv:4.7.0-gpu-cuda-11.2.2-dev
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

opencv-ubuntu-18-04:
name: opencv-ubuntu-18-04
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gocv/opencv
ghcr.io/${{ github.repository }}/opencv
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: Dockerfile.opencv-ubuntu-18.04
platforms: linux/amd64
context: .
push: true
tags: gocv/opencv:4.7.0-ubuntu-18.04-dev
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

opencv-ubuntu-20-04:
name: opencv-ubuntu-20-04
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gocv/opencv
ghcr.io/${{ github.repository }}/opencv
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: Dockerfile.opencv-ubuntu-20.04
platforms: linux/amd64
context: .
push: true
tags: gocv/opencv:4.7.0-ubuntu-20.04-dev
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 0fd8d4e

Please sign in to comment.