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?

  • How to add directory to existing Data container in Docker?
  • How to connect to PostgreSQL server that's run on docker
  • Is docker phasing out some sites and services or something?
  • gcloud ping attempt failure with performing a 'docker push'
  • Why Cluster NodeJS vs Docker, And What About Einhorn?
  • New to docker, is it possible to protect my source code and add permissions?
  • boot2docker equivalent of docker exec
  • Weird terminal formatting on Windows
  • docker login <dtr-server> gives error 404 not found
  • How to copy files from dockerfile to host?
  • Correct way to detach from a container without stopping it
  • Problems accessing multiple docker containers remotely
  • 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.