From 4cd5ca6782878fce2ba4ac3c08ee50810a145ab0 Mon Sep 17 00:00:00 2001 From: joschrew <91774427+joschrew@users.noreply.github.com> Date: Tue, 20 Aug 2024 16:28:56 +0200 Subject: [PATCH 1/3] Fix copy command in dockerfile --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 762ec43..b415e8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ COPY requirements.txt . COPY requirements_test.txt . COPY .git .git COPY .gitmodules . -COPY ocrd_tesserocr . +COPY ocrd_tesserocr ocrd_tesserocr COPY repo/tesserocr repo/tesserocr COPY repo/tesseract repo/tesseract COPY Makefile . @@ -66,7 +66,5 @@ RUN ln -s $XDG_CONFIG_HOME/ocrd-tesserocr-recognize $TESSDATA_PREFIX # finally, alias/symlink all ocrd-resources to /models for shorter mount commands RUN mv $XDG_CONFIG_HOME /models && ln -s /models $XDG_CONFIG_HOME - -# finally, alias/symlink all ocrd-resources to /models for shorter mount commands WORKDIR /data VOLUME /data From 7fc40713445cb4e4fb8af971e077449b71da838b Mon Sep 17 00:00:00 2001 From: Robert Sachunsky <38561704+bertsky@users.noreply.github.com> Date: Tue, 20 Aug 2024 16:55:00 +0200 Subject: [PATCH 2/3] CI: test Docker builds --- .circleci/config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ca205b..51d9bb9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,6 +29,19 @@ jobs: - run: make coverage - codecov/upload + build-docker: + docker: + - image: circleci/buildpack-deps:stretch + environment: + DOCKER_TAG: ocrd/tesserocr + steps: + - checkout + - run: git submodule sync && git submodule update --init + - setup_remote_docker: # https://circleci.com/docs/2.0/building-docker-images/ + docker_layer_caching: true + - run: make docker DOCKER_TAG=$DOCKER_TAG + - run: docker run --rm $DOCKER_TAG ocrd-tesserocr-segment -h + deploy-docker: docker: - image: circleci/buildpack-deps:stretch @@ -40,6 +53,7 @@ jobs: - setup_remote_docker: # https://circleci.com/docs/2.0/building-docker-images/ docker_layer_caching: true - run: make docker DOCKER_TAG=$DOCKER_TAG + - run: docker run --rm $DOCKER_TAG ocrd-tesserocr-segment -h - run: name: Login to Docker Hub command: echo "$DOCKERHUB_PASS" | docker login --username "$DOCKERHUB_USER" --password-stdin @@ -62,6 +76,8 @@ workflows: matrix: parameters: python-version: ['3.7', '3.8', '3.9', '3.10'] + - build-docker + deploy: when: condition: From ce249ab94b4e9e82f4db59045d22d2e9f432b80e Mon Sep 17 00:00:00 2001 From: Robert Sachunsky <38561704+bertsky@users.noreply.github.com> Date: Tue, 20 Aug 2024 16:55:49 +0200 Subject: [PATCH 3/3] CI: test Docker builds --- .github/workflows/docker-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index fccc6aa..d0bbe8e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -34,6 +34,8 @@ jobs: run: echo "IMAGE_NAME=ghcr.io/${REPO_NAME,,}" >> $GITHUB_ENV - name: Build the Docker image run: make docker DOCKER_TAG=${{ env.IMAGE_NAME }} + - name: Test the Docker image + run: docker run --rm ${{ env.IMAGE_NAME }} ocrd-tesserocr-segment -h - name: Push to Github Container Registry run: docker push ${{ env.IMAGE_NAME }}