Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile update #96

Merged
merged 4 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Patch and build Olena from Git, then
# Install OCR-D wrapper for binarization
FROM ocrd/core
FROM ocrd/core:v2.62.0 AS base
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If similar changes are made for more processors, new releases of OCR-D would require a lot of additional work.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle – yes. But practically, the opposite is true – without pinning to a specific version, the module maintainers are always forced to react timely to things broken by upstream OCR-D. By pinning, we the maintainer can make a conscious decision on whether and when to update.

Of course, we should at some point do the same thing with pure Python requirements. But for native installation (or ocrd_all via Docker) we currently cannot, because as long as our packages will live in a large unisolated venv, pinning would immediately shrink the intersection of compatible versions to zero. On the other hand, Docker modules are the way to go for greater isolation, and pinning here will now on offer some protection against breaking changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think the added effort of hardcoding a specific version is worth the reproducibility and since it does not concern the deployment with ocrd_all (yet), I see no reason not to.

kba marked this conversation as resolved.
Show resolved Hide resolved
ARG VCS_REF
ARG BUILD_DATE
bertsky marked this conversation as resolved.
Show resolved Hide resolved
LABEL \
maintainer="https://github.com/OCR-D/ocrd_olena/issues" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/OCR-D/ocrd_olena" \
org.label-schema.build-date=$BUILD_DATE

MAINTAINER OCR-D

Expand All @@ -26,7 +33,3 @@ RUN apt-get update && \

WORKDIR /data
VOLUME /data

#ENTRYPOINT ["/usr/bin/ocrd-olena-binarize"]
#CMD ["--help"]
CMD ["/usr/bin/ocrd-olena-binarize", "--help"]
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,14 @@ clean:
$(RM) -r test/assets

docker: build-olena.dockerfile Dockerfile
docker build -t $(DOCKER_TAG):build-olena -f build-olena.dockerfile .
docker build -t $(DOCKER_TAG) .
docker build \
--build-arg VCS_REF=$$(git rev-parse --short HEAD) \
--build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t $(DOCKER_TAG):build-olena -f build-olena.dockerfile .
docker build \
--build-arg VCS_REF=$$(git rev-parse --short HEAD) \
--build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t $(DOCKER_TAG) .

.PHONY: build-olena clean-olena deps deps-ubuntu help install install-tools test clean docker

Expand Down
7 changes: 7 additions & 0 deletions build-olena.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Patch and build Olena from Git
FROM ubuntu:18.04
ARG VCS_REF
ARG BUILD_DATE
LABEL \
maintainer="https://github.com/OCR-D/ocrd_olena/issues" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/OCR-D/ocrd_olena" \
org.label-schema.build-date=$BUILD_DATE

MAINTAINER OCR-D

Expand Down