docker java7 install fail

The -y in your apt-get install commands is telling apt-get to “assume yes”, which isn’t the same as running in non-interactive mode.

You’re seeing the “unable to initialize frontend: Dialog” messages because Debian is running apt-get in interactive mode. To tell it to run in non-interactive mode, add this line to the start of your Dockerfile:

ENV DEBIAN_FRONTEND noninteractive

Now your commands will be running in non-interactive mode, so apt-get won’t try and pop any dialogs up.

As for your actual error, you’re right, add-apt-repository is a part of the python-software-properties. Try putting your apt-get update -y command above your apt-get install python-software-properties command.

RUN apt-get update -y                             && \
    apt-get install python-software-properties -y && \
    add-apt-repository ppa:webupd8team/java -y    && \
    apt-get update -y                             && \
    apt-get install oracle-java7-installer -y     && \
    oracle-java7-set-default

Note, you’ll need to do two apt-get update -y commands, one before you start (always a good habit to get into) and one after you’ve added the oracle java PPA.

apt-get manual

Docker ENV docs

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)