Skip to content

Docker Image CI

Docker Image CI #4

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
workflow_dispatch: # run manually
env:
# FIXME: linux/arm/v7 disabled as long as scikit-build/cmake-python-distributions#503 is unresolved
# PLATFORMS: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le
# FIXME: linux/ppc64le probably similar cause for "Installing build dependencies: still running..."
# PLATFORMS: linux/amd64,linux/arm64/v8,linux/ppc64le
PLATFORMS: linux/amd64,linux/arm64/v8
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
env:
# build both tags at once:
DOCKER_BASE_TAG: ghcr.io/ocr-d docker.io/ocrd
# replace native build with buildx
DOCKER_BUILD_CMD: docker buildx build --progress=plain --push --platform
steps:
- name: Export variables
run: |
echo "DOCKER_BASE_TAG=${{ env.DOCKER_BASE_TAG }}" >> $GITHUB_ENV
echo "DOCKER_BUILD=${{ env.DOCKER_BUILD_CMD }} ${{ env.PLATFORMS }}" >> $GITHUB_ENV
- name: Print variables
run: |
echo DOCKER_BASE_TAG=${DOCKER_BASE_TAG}
echo DOCKER_BUILD=${DOCKER_BUILD}
- name: Checkout
uses: actions/checkout@v4
with:
# we need tags for docker version tagging
fetch-tags: true
fetch-depth: 0
- # Activate cache export feature to reduce build time of images
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}
- name: Build the Docker image
run: make docker
- name: Build the Docker image with GPU support
run: make docker-cuda
- name: Build the Docker images with GPU support and ML frameworks
run: make docker-cuda-tf1 docker-cuda-tf2 docker-cuda-torch