Skip to content

Commit 071e6a8

Browse files
authored
Merge pull request #120 from joschrew/dockerfile
Add Dockerfile and Makefile to create ocr-d dockerimage
2 parents 2e6fe0c + 6b82293 commit 071e6a8

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ARG DOCKER_BASE_IMAGE
2+
FROM $DOCKER_BASE_IMAGE
3+
ARG VCS_REF
4+
ARG BUILD_DATE
5+
LABEL \
6+
maintainer="https://github.com/qurator-spk/dinglehopper/issues" \
7+
org.label-schema.vcs-ref=$VCS_REF \
8+
org.label-schema.vcs-url="https://github.com/qurator-spk/dinglehopper" \
9+
org.label-schema.build-date=$BUILD_DATE
10+
11+
WORKDIR /build/dinglehopper
12+
COPY pyproject.toml .
13+
COPY src/dinglehopper/ocrd-tool.json .
14+
COPY src ./src
15+
COPY requirements.txt .
16+
COPY README.md .
17+
COPY Makefile .
18+
RUN make install
19+
RUN rm -rf /build/dinglehopper
20+
21+
WORKDIR /data
22+
VOLUME ["/data"]

Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
PYTHON = python3
2+
PIP = pip3
3+
PYTHONIOENCODING=utf8
4+
5+
DOCKER_BASE_IMAGE = docker.io/ocrd/core:v2.69.0
6+
DOCKER_TAG = ocrd/dinglehopper
7+
8+
help:
9+
@echo
10+
@echo " Targets"
11+
@echo
12+
@echo " install Install full Python package via pip"
13+
@echo " docker Build the ocrd/dinglehopper docker image"
14+
15+
# Install Python package via pip
16+
install:
17+
$(PIP) install .
18+
19+
docker:
20+
docker build \
21+
--build-arg DOCKER_BASE_IMAGE=$(DOCKER_BASE_IMAGE) \
22+
--build-arg VCS_REF=$$(git rev-parse --short HEAD) \
23+
--build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
24+
-t $(DOCKER_TAG) .
25+
26+
.PHONY: help install docker

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ optional-dependencies.dev = {file = ["requirements-dev.txt"]}
4949
where = ["src"]
5050

5151
[tool.setuptools.package-data]
52-
dinglehopper = ["templates/*"]
52+
dinglehopper = ["templates/*", "*.json"]
5353

5454

5555
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)