spotlight-docker
spotlight-docker copied to clipboard
v1.0/english Dockerfile does not build
I get this output when trying to build the v1.0/english Docker image:
$ docker build -f Dockerfile -t english_spotlight . Sending build context to Docker daemon 4.608kB
Step 1/9 : FROM openjdk:8-jre-alpine
---> 7e72a7dcf7dc
Step 2/9 : MAINTAINER DBpedia Spotlight Team <[email protected]>
---> Using cache
---> 3995abdb63de
Step 3/9 : ENV RELEASE_SERVER downloads.dbpedia-spotlight.org
---> Using cache
---> 5ec8117b6337
Step 4/9 : ENV RELEASE_FILENAME dbpedia-spotlight-1.0.0.jar
---> Using cache
---> dab298eb06b7
Step 5/9 : ENV LANGUAGE_MODEL en_2+2.tar.gz
---> Using cache
---> 396042349550
Step 6/9 : RUN apk add --no-cache curl && mkdir -p /opt/spotlight && cd /opt/spotlight && curl -O "http://$RELEASE_SERVER/spotlight/$RELEASE_FILENAME" && curl -O "http://$RELEASE_SERVER/2016-04/en/model/$LANGUAGE_MODEL" && tar xvf $LANGUAGE_MODEL && rm $LANGUAGE_MODEL && apk del curl
---> Running in fd14ae2c3cb6
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/4) Installing nghttp2-libs (1.32.0-r0)
(2/4) Installing libssh2 (1.8.0-r3)
(3/4) Installing libcurl (7.61.1-r1)
(4/4) Installing curl (7.61.1-r1)
Executing busybox-1.28.4-r2.trigger
OK: 83 MiB in 56 packages
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 277 100 277 0 0 551 0 --:--:-- --:--:-- --:--:-- 551
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 270 100 270 0 0 540 0 --:--:-- --:--:-- --:--:-- 538
tar: invalid tar magic
The command '/bin/sh -c apk add --no-cache curl && mkdir -p /opt/spotlight && cd /opt/spotlight && curl -O "http://$RELEASE_SERVER/spotlight/$RELEASE_FILENAME" && curl -O "http://$RELEASE_SERVER/2016-04/en/model/$LANGUAGE_MODEL" && tar xvf $LANGUAGE_MODEL && rm $LANGUAGE_MODEL && apk del curl' returned a non-zero code: 1
Hey there, I also had the same problem.
It seems that the sourceforge urls provided inside the Dockerfile redirect to another page, which contains the file itself. So, all you have to do is to replace the urls with the redirected one. In my case, I changed the Dockerfile as follows:
FROM openjdk:8-jre-alpine
MAINTAINER DBpedia Spotlight Team <[email protected]>
RUN apk add --no-cache curl && \
mkdir -p /opt/spotlight && \
cd /opt/spotlight && \
curl -O "https://ufpr.dl.sourceforge.net/project/dbpedia-spotlight/spotlight/dbpedia-spotlight-1.0.0.jar" && \
curl -O "https://ufpr.dl.sourceforge.net/project/dbpedia-spotlight/2016-04/en/model/en_2+2.tar.gz" && \
tar xvf en_2+2.tar.gz && \
rm en_2+2.tar.gz && \
apk del curl
ADD spotlight.sh /bin/spotlight.sh
RUN chmod +x /bin/spotlight.sh
EXPOSE 80