Skip to content

Commit

Permalink
Merge pull request #219 from OCR-D/fix-docker
Browse files Browse the repository at this point in the history
Fix broken docker image
  • Loading branch information
bertsky authored Aug 20, 2024
2 parents 1f34996 + ce249ab commit dcbd522
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -62,6 +76,8 @@ workflows:
matrix:
parameters:
python-version: ['3.7', '3.8', '3.9', '3.10']
- build-docker

deploy:
when:
condition:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand All @@ -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

0 comments on commit dcbd522

Please sign in to comment.