Use STDIN during docker build from a Dockerfile

I’m trying to install Miniconda in a docker image as a first step, right now this is what I have:

    FROM ubuntu:14.04
RUN apt-get update && apt-get install wget
RUN wget *miniconda download URL* && bash file_downloaded.sh

When I try to build the image, it goes well until it starts popping the following message continously:
>>> Please answer ‘yes’ or ‘no’
At that point I need to stop docker build. How can I fix it? Should I include something in the dockerfile?

  • Docker DNS Server not contactable outsid container
  • Docker images won't start sometime and it error logs says something I cannot understand
  • Mount a Virtualbox shared folder as a volume for Docker running on the guest OS
  • Is there any way to “apply a patch” to a docker image?
  • Kitematic spins up new containers, but none of them showing up in Terminal
  • Creating a table in single user mode in postgres
  • Pulling Docker Images from Private Repository using REGISTRY REST API
  • Reset Docker Machine to run Docker commands on my local machine
  • Unsatisfiable constraints when installing packages on docker alpine
  • How to change location of “.docker” directory
  • Mount volume through boot2docker to the postgres container
  • How to configure spring interceptor to get called with every request
  • 2 Solutions collect form web for “Use STDIN during docker build from a Dockerfile”

    I believe you can pass -b flag to miniconda shell script to avoid manual answering

    Installs Miniconda3 4.0.5
    
        -b           run install in batch mode (without manual intervention),
                     it is expected the license terms are agreed upon
        -f           no error if install prefix already exists
        -h           print this help message and exit
        -p PREFIX    install prefix, defaults to $PREFIX
    

    something like that:

    RUN wget http://......-x86_64.sh -O miniconda.sh
    RUN chmod +x miniconda.sh \
        && bash ./miniconda.sh -b
    

    You can’t attach interactive tty during image build. If it is asking for ‘yes’ or ‘no’ during package installation, wget in your case, you can replace the corresponding line with RUN apt-get update -qq && apt-get install -y wget. If it is bash file_downloaded.sh, check if file_downloaded.sh accepts ‘yes’ or ‘no’ as a command line argument.

    If file_downloaded.sh doesn’t have that option, create a container from ubuntu:14.04 image, install wget and run your commands manually there. Then, you can make an image of the container by committing your changes like: docker commit <cotainer_id> <image_name>.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.