dice-group / Palmetto

Palmetto is a quality measuring tool for topics
GNU Affero General Public License v3.0
209 stars 36 forks source link

Unable to build docker Ubuntu 16.04.3 #14

Closed maksimt closed 6 years ago

maksimt commented 6 years ago

Hi I am trying to build the docker container. The reason is I am trying to evaluate a lot of different topic models (hyper parameter tuning), and using the web API as well as the jar is really slow.

I issue the command:

docker build -t palmetto .

The error seems to be about the docker not being able to resolve the apt-get repository:

Step 2 : RUN apt-get update &&         apt-get install -y maven openjdk-8-jdk
 ---> Running in d37ec6b50364
Err:1 http://security.debian.org stretch/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian stretch InRelease
  Temporary failure resolving 'deb.debian.org'
Err:3 http://deb.debian.org/debian stretch-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package maven
E: Unable to locate package openjdk-8-jdk
The command '/bin/sh -c apt-get update &&         apt-get install -y maven openjdk-8-jdk' returned a non-zero code: 100

I am new to docker. I tried the default FROM tomcat:8.0.32-jre8 as well as FROM tomcat:8.0.47-jre8 and FROM tomcat:9.0.1-jre8. All lead to the same error.

maksimt commented 6 years ago

It was a DNS issue,

For docker run --dns=8.8.8.8 works, but for build there is no --dns option. Instead, I had to prepend

echo "search dns.example.com" > /etc/resolv.conf && echo "nameserver 10.1.35.1" > /etc/resolv.conf

to the sudo apt-get RUN and the mvn clean lines.

MichaelRoeder commented 6 years ago

@maksimt I am sorry that you encountered this problem. Thanks for posting the solution :+1: