diff --git a/Dockerfile b/Dockerfile index f64d276..8968ea7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM ocrd/core-cuda +ARG DOCKER_BASE_IMAGE +FROM $DOCKER_BASE_IMAGE ARG VCS_REF ARG BUILD_DATE LABEL \ @@ -10,13 +11,7 @@ LABEL \ ENV DEBIAN_FRONTEND noninteractive ENV PYTHONIOENCODING utf8 -# avoid HOME/.local/share (hard to predict USER here) -# so let XDG_DATA_HOME coincide with fixed system location -# (can still be overridden by derived stages or at runtime) -# should be combined with a bind-mount at runtime -ENV XDG_DATA_HOME /usr/local/share - -WORKDIR /build-ocrd +WORKDIR /build/ocrd_detectron2 COPY setup.py . COPY ocrd_detectron2/ocrd-tool.json . COPY README.md . @@ -27,11 +22,8 @@ COPY Makefile . RUN apt-get install -y --no-install-recommends g++ && \ make deps && \ make install && \ - rm -rf /build-ocrd && \ + rm -rf /build/ocrd_detectron2 && \ apt-get -y remove --auto-remove g++ WORKDIR /data VOLUME /data - -# override Nvidia entrypoint -ENTRYPOINT [] diff --git a/Makefile b/Makefile index a30f19c..c917e65 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ PYTHONIOENCODING=utf8 SHELL = /bin/bash # Docker container tag -DOCKER_TAG = 'bertsky/ocrd_detectron2' +DOCKER_BASE_IMAGE = docker.io/ocrd/core-cuda-torch:v2.69.0 +DOCKER_TAG = 'ocrd/detectron2' help: @echo @@ -94,6 +95,7 @@ clean: # Build docker image docker: docker build \ + --build-arg DOCKER_BASE_IMAGE=$(DOCKER_BASE_IMAGE) \ --build-arg VCS_REF=$$(git rev-parse --short HEAD) \ --build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ -t $(DOCKER_TAG) .