Description of problem: I have a docker script that does a maven build of java code. The dockerfile has been working for me for more than a year. Recently I found it stopped working with a java backtrace. However, maven builds of the same project worked on my desktop, with the same version of Fedora as the docker image. After trying all packages installed on my laptop but not in the docker image, I found maven is only working if and only if firefox is installed. Not the dependancies, but firefox itself. Otherwise maven crashes the first time it attempts to download a dependancies. So now my line for installing dependancies looks like: RUN dnf -y update --skip-broken ; dnf -y install maven git bzip2 rpm-build firef ox && dnf clean all Significantly increasing my docker image size. On a related note, I recently build an image for sublime-text-3. I found in that image I had to install firefox and I had to volume mount /var/lib/sss because when sublime-text-3 opens a link firefox will get called which will then in turn send a message through sssd to firefox running outside the docker container. sublime-text-3 was unable to open firefox directly inside the container, even though I have the X11 display exported, because sssd is not running inside the container... I point out this related issue with sublime-text-3 as it may provide a useful clue how firefox ends up being a dependency of maven. I doubt maven is directly calling firefox, but the way the docker container is being connected to the dbus is probably result on it being used for java. Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. Attempt to build a docker image that does a maven build. 2. 3. Actual results: Stack dump. Expected results: Image builds. Additional info: For reference here is the complete Dockerfile I use. Without firefox, the failure happen at the "mvn clean" step. $ cat Dockerfile FROM fedora MAINTAINER briemers <briemers> ENV LANG en_US.UTF-8 RUN dnf -y update --skip-broken ; dnf -y install maven git bzip2 rpm-build firefox && dnf clean all RUN adduser -d /home/sfuser sfuser COPY . /sfjavasuite.git RUN ( [ -d /sfjavasuite.git ] || mkdir /sfjavasuite.git ) && chown -R sfuser /sfjavasuite.git USER sfuser WORKDIR /sfjavasuite.git ENV HOME /home/sfuser RUN mkdir "$HOME/.m2" && cp settings.xml "$HOME/.m2/." RUN mvn clean RUN mvn compile RUN mvn package install RUN chmod -R ugo+rX . CMD ["/bin/bash", "-i"]
This is not a docker issue. Perhaps this is a maven issue.
Could you please share the java backtrace with us? Is is possible that you're trying to run some kind of selenium tests during the build, which require browser?
Created attachment 1156700 [details] Build log without firefox on Fedora 23. Output of the command: $ (docker build --no-cache --rm -t sfjavasuite . 2>&1) |tee /tmp/build.log The code I'm building is available inside the RedHat firewall via the command: $ git clone http://gitolite.corp.redhat.com/cgit/it-sales/sfjavasuite.git/ Currently the repository has firefox listed in the Dockerfile.
BTW. I just tried the same test on RHEL6. I am comforted by the fact, at least it produces the same error. Which indicates it probably is not a bug with docker, but rather with the fedora images. I tried a Fedora:22 base, with the same results. Fedora:21 works after changing dnf to yum... Indicating the problem is one of three things: 1. Maven has been updated in Fedora 22 and Fedora 23 to introduce this dependancy. (It as recently as a couple of months ago.) 2. There has been some update to the standard docker images that adds this hidden dependancy. 3. There is something in docker's fake dbus stuff that is adding the runtime dependency. I can't think of any other possibilities, and I'm not sure how to isolate this down to which possibility this is.
Please remove ANSI codes from logs, they make them unreadable. Then run Maven with -X switch to enable debugging output.
I think I can reasonably rule out possibility 3. The build works without firefox for Fedora:21, Centos, and even Ubuntu. (OK, Ubuntu fails from the lack of rpm-build, but it makes it past the mvn clean command...) If it was a fake dbus issue I would expect to effect pretty much any up to date linux image.
I think it might be the same issue as bug#1332456. Investigating.
I think this is the problem: Step 4 : RUN dnf -y update --skip-broken ; dnf -y install maven git bzip2 rpm-build && dnf clean all ---> Running in 5997e11ebb4e Last metadata expiration check performed 0:00:08 ago on Thu May 12 13:42:21 2016. No match for argument: --skip-broken So you don't really update packages in the image, and when you later install firefox, it will also update nss package, because firefox depends on it. And because of bug#1332456, JDK sometimes throws java.lang.InternalError exception, if nss version doesn't match JDK's expectations. Long story short, replacing following line in your Dockerfile: RUN dnf -y update --skip-broken ; dnf -y install maven git bzip2 rpm-build firefox && dnf clean all with this line: RUN dnf -y update && dnf -y install maven git bzip2 rpm-build && dnf clean all should fix the issue.
Created attachment 1156711 [details] Build log without firefox on Fedora 23, with -X option and stripping color codes Output of: (docker build --no-cache --rm -t sfjavasuite-x . 2>&1) |tr '\r' '\n' |sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g'|tee /tmp/build.log BTW. I tried running with TERM=dumb, but both docker and maven ignore the terminal setting and produce color ansi regardless of the terminal being used.
Interesting. I had already tried adding the nss packages into the list. In fact I added every package firefox depends on. But without firefox itself, it still failed. But perhaps I had a similar bug in that RUN line. I've been tempting in the past just to leave the "dnf update -y" out completely. The base image is usually fairly current, so strictly speaking it should not really be needed. Looks like though it really is needed. Thank you.