This repository has been archived by the owner on Jul 26, 2018. It is now read-only.
forked from kermitt2/grobid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (29 loc) · 1.59 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
## Docker GROBID image
# Reminder: Before building the docker GROBID image, remember to build grobid using the profile docker, in
# order to correctly set up the grobid-home in the web.xml.
# > mvn clean install -P docker
# > docker build -t lfoppiano/grobid:GROBID_VERSION --build-arg GROBID_VERSION=GROBID_VERSION .
# Example: > docker build -t lfoppiano/grobid:1.0.0 --build-arg GROBID_VERSION=1.0.0 .
# > docker run -t --rm -p 8080:8080 {image_name}
# To connect to the container with a bash shell
# > docker exec -i -t {container_name} /bin/bash
FROM jetty:9.3-jre8
MAINTAINER Luca Foppiano <[email protected]>, Patrice Lopez <[email protected]>
ARG GROBID_VERSION
LABEL Description="This image is used to generate a GROBID image" Version="${GROBID_VERSION}"
ENV JAVA_OPTS=-Xmx4g
RUN apt-get update && apt-get -y --no-install-recommends install libxml2
ADD ./grobid-home/target/grobid-home-${GROBID_VERSION}.zip /opt
RUN unzip /opt/grobid-home-${GROBID_VERSION}.zip -d /opt && rm /opt/grobid-home-${GROBID_VERSION}.zip
COPY ./grobid-service/target/grobid-service-${GROBID_VERSION}.war /var/lib/jetty/webapps/ROOT.war
# Workaround otherwise the tmp directory is not writeable (owner is root)
RUN mkdir /opt/grobid-home/tmp
RUN chown -R jetty:jetty /opt/grobid-home/
VOLUME /opt/grobid-home/tmp
## Docker tricks:
# - remove all stopped containers
# > docker rm $(docker ps -a -q)
# - remove all untagged images
# > docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
# - "Cannot connect to the Docker daemon. Is the docker daemon running on this host?"
# > docker-machine restart