skip to Main Content

I’m trying to execute this script https://repo.anaconda.com/miniconda/Miniconda3-py38_23.1.0-1-Linux-x86_64.sh in a Dockerfile.

# I have already downloaded the file
RUN bash Miniconda3-py38_23.1.0-1-Linux-x86_64.sh

When I launch it I got this error:

RUN bash Miniconda3-py38_23.1.0-1-Linux-x86_64.sh:
#0 0.411 
#0 0.411 Welcome to Miniconda3 py38_23.1.0-1
#0 0.411 
#0 0.411 In order to continue the installation process, please review the license
#0 0.411 agreement.
#0 0.411 Please, press ENTER to continue
#0 0.411 >>>

I found here that you can add yes '' before your script to "auto confirm"

# I have already downloaded the file
RUN yes | bash Miniconda3-py38_23.1.0-1-Linux-x86_64.sh

But when I do this I got:

RUN yes '' | bash Miniconda3-py38_23.1.0-1-Linux-x86_64.sh                                                                                                                                                               6.5s
 => => # >>> Please answer 'yes' or 'no':'                                                                                                                                                                                             
 => => # >>> Please answer 'yes' or 'no':'                                                                                                                                                                                             
 => => # >>> Please answer 'yes' or 'no':'                                                                                                                                                                                             
 => => # >>> Please answer 'yes' or 'no':'                                                                                                                                                                                             
 => => # >>> Please answer 'yes' or                                                                                                                                                                                                    
 => => # [output clipped, log limit 200KiB/s reached]

Is there a way to tell bash to run this script in a non interactive mode and accept default parameters by default ?

2

Answers


  1. RUN yes '' | ...

    That invocation of yes produces empty strings.

    % yes '' | head -n 1
    
    

    You want it to say ‘yes’ so you should actually specify that.

    % yes 'yes' | head -n 1                                                                                                                                                                   
    yes
    
    Login or Signup to reply.
  2. Do:

    RUN bash Miniconda3-py38_23.1.0-1-Linux-x86_64.sh -b
    

    See Miniconda3-py38_23.1.0-1-Linux-x86_64.sh -h

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search