ishkin / Proton

IBM Proactive Technology Online
24 stars 21 forks source link

Docker build: Error "The following packages cannot be authenticated!" #19

Closed jkrenge closed 9 years ago

jkrenge commented 9 years ago

I am trying to build the Dockerfile with Docker version 1.8.3, build f4bf5c7.

But I get this result on installing java7:

Step 6 : RUN apt-get -y install oracle-java7-installer
 ---> Running in f110b3b96bc6
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  binutils gsfonts gsfonts-x11 java-common libfontenc1 libfreetype6 libxfont1
  wget x11-common xfonts-encodings xfonts-utils
Suggested packages:
  binutils-doc default-jre equivs binfmt-support visualvm ttf-baekmuk
  ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic
  ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming firefox firefox-2
  iceweasel mozilla-firefox iceape-browser mozilla-browser epiphany-gecko
  epiphany-webkit epiphany-browser galeon midbrowser moblin-web-browser
  xulrunner xulrunner-1.9 konqueror chromium-browser midori google-chrome
The following NEW packages will be installed:
  binutils gsfonts gsfonts-x11 java-common libfontenc1 libfreetype6 libxfont1
  oracle-java7-installer wget x11-common xfonts-encodings xfonts-utils
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 7002 kB of archives.
After this operation, 20.6 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  oracle-java7-installer
E: There are problems and -y was used without --force-yes
The command '/bin/sh -c apt-get -y install oracle-java7-installer' returned a non-zero code: 100

Could this related to the fact that I had to install docker in sudo?

andreimarinescu commented 9 years ago

Hi Julian,

Could you try out the following: edit the Dockerfile, and replace:

RUN apt-get -y install oracle-java7-installer

with

RUN apt-get -y --force-yes install oracle-java7-installer
jkrenge commented 9 years ago

Oh wow, thanks for the quick & correct answer! That was totally it. I'm new to Docker, and I tried to put the --force-yes somewhere in the docker command.

So, resolved. Line 11 in the Dockerfile needs to be replaced with:

RUN apt-get -y --force-yes install oracle-java7-installer

Thanks @andreimarinescu!

andreimarinescu commented 9 years ago

No problem! Glad it worked.

I'll push out a commit with this fix as well.

jkrenge commented 9 years ago

Edit: Yes, I should probably just open a new issue for that...

Sorry, maybe one quick question. When I run the docker now, everything seems fine:

INFO: init: done initializing singletons , starting the servers...
Oct 29, 2015 9:32:39 PM com.ibm.hrl.proton.server.adapter.OutputServer run
INFO: Proton output server started, listening on output port: 3302
Oct 29, 2015 9:32:39 PM com.ibm.hrl.proton.server.adapter.InputServer run
INFO: Proton server Started, listening on port: 3002
Oct 29, 2015 9:32:39 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/ProtonOnWebServerAdmin.war
Oct 29, 2015 9:32:40 PM com.ibm.hrl.proton.admin.webapp.ProtonAdminServletContextListener contextInitialized
INFO: initializing ProtonAdminServletContextListener
Oct 29, 2015 9:32:40 PM com.ibm.hrl.proton.admin.webapp.ProtonAdminServletContextListener contextInitialized
INFO: created popertiesFileInputStream = java.io.ByteArrayInputStream@716fd193
Oct 29, 2015 9:32:40 PM com.ibm.hrl.proton.admin.webapp.ProtonAdminServletContextListener contextInitialized
INFO: getServletContext().getRealPath(/) = /var/lib/tomcat7/webapps/ProtonOnWebServerAdmin/
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Oct 29, 2015 9:32:41 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Oct 29, 2015 9:32:41 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Oct 29, 2015 9:32:41 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8523 ms

But when I try to reach it from the Docker host, the connection is refused:

ubuntu@cep-host:~$ curl http://localhost:8080/AuthoringTool/Main.html
curl: (7) Failed to connect to localhost port 8080: Connection refused

Do you maybe have an idea about that as well?

andreimarinescu commented 9 years ago

Likely it's the same issue as here: https://github.com/ishkin/Proton/issues/14

Try to explicitly expose the port (-p 8080:8080)

jkrenge commented 9 years ago

Wow, you're good. Thanks!