build: claim back space so cuda builds can complete #32
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 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:4.8.1 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1 | |
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/[email protected] | |
with: | |
file: Dockerfile.opencv | |
platforms: linux/amd64,linux/arm64 | |
context: . | |
push: true | |
tags: | | |
gocv/opencv:latest | |
gocv/opencv:4.8.1 | |
ghcr.io/${{ github.repository_owner }}/opencv:latest | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1 | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
opencv-static: | |
name: opencv-static | |
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:4.8.1-static | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-static | |
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/[email protected] | |
with: | |
file: Dockerfile.opencv-static | |
platforms: linux/amd64,linux/arm64 | |
context: . | |
push: true | |
tags: | | |
gocv/opencv:4.8.1-static | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-static | |
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: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
remove-dotnet: 'true' | |
remove-android: 'true' | |
remove-haskell: 'true' | |
remove-codeql: 'true' | |
- 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:4.8.1-gpu-cuda-11 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-gpu-cuda-11 | |
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/[email protected] | |
with: | |
file: Dockerfile.opencv-gpu-cuda-11 | |
platforms: linux/amd64 | |
context: . | |
push: true | |
tags: | | |
gocv/opencv:4.8.1-gpu-cuda-11 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-gpu-cuda-11 | |
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: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
remove-dotnet: 'true' | |
remove-android: 'true' | |
remove-haskell: 'true' | |
remove-codeql: 'true' | |
- 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:4.8.1-gpu-cuda-11.2.2 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-gpu-cuda-11.2.2 | |
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/[email protected] | |
with: | |
file: Dockerfile.opencv-gpu-cuda-11.2.2 | |
platforms: linux/amd64 | |
context: . | |
push: true | |
tags: | | |
gocv/opencv:4.8.1-gpu-cuda-11.2.2 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-gpu-cuda-11.2.2 | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
opencv-gpu-cuda-12: | |
name: opencv-gpu-cuda-12 | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
remove-dotnet: 'true' | |
remove-android: 'true' | |
remove-haskell: 'true' | |
remove-codeql: 'true' | |
- 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:4.8.1-gpu-cuda-12 | |
ghcr.io/${{ github.repository_owner }}/opemcv:4.8.1-gpu-cuda-12 | |
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/[email protected] | |
with: | |
file: Dockerfile.opencv-gpu-cuda-12 | |
platforms: linux/amd64 | |
context: . | |
push: true | |
tags: | | |
gocv/opencv:4.8.1-gpu-cuda-12 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-gpu-cuda-12 | |
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:4.8.1-ubuntu-18.04 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-ubuntu-18.04 | |
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/[email protected] | |
with: | |
file: Dockerfile.opencv-ubuntu-18.04 | |
platforms: linux/amd64 | |
context: . | |
push: true | |
tags: | | |
gocv/opencv:4.8.1-ubuntu-18.04 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-ubuntu-18.04 | |
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:4.8.1-ubuntu-20.04 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-ubuntu-20.04 | |
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.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/[email protected] | |
with: | |
file: Dockerfile.opencv-ubuntu-20.04 | |
platforms: linux/amd64 | |
context: . | |
push: true | |
tags: | | |
gocv/opencv:4.8.1-ubuntu-20.04 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-ubuntu-20.04 | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
opencv-ubuntu-22-04: | |
name: opencv-ubuntu-22-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:4.8.1-ubuntu-22.04 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-ubuntu-22.04 | |
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.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/[email protected] | |
with: | |
file: Dockerfile.opencv-ubuntu-22.04 | |
platforms: linux/amd64 | |
context: . | |
push: true | |
tags: | | |
gocv/opencv:4.8.1-ubuntu-22.04 | |
ghcr.io/${{ github.repository_owner }}/opencv:4.8.1-ubuntu-22.04 | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |