Home > Mobile >  Entry by terminal when running a Dockerfile
Entry by terminal when running a Dockerfile

Time:02-04

I have a Dockerfile where I want to run the following command to get Rust and Cargo:

RUN curl https://sh.rustup.rs -sSf | sh

However, when executing it by hand in the terminal (not in the Dockerfile, but just running curl https://sh.rustup.rs -sSf | sh), it asks me to include the type of installation by hand:

Current installation options:


   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
> 1 (this is what i enter)

Thus, when executing the above in the Dockerfile, it is not possible to select the option and it gives me the following error.

Step 3/6 : RUN curl https://sh.rustup.rs -sSf | sh
 ---> Running in d03d6ff33b9f
info: downloading installer
rustup: Unable to run interactively. Run with -y to accept defaults, --help for additional options
The command '/bin/sh -c curl https://sh.rustup.rs -sSf | sh' returned a non-zero code: 1

Do you know how I should proceed in the Dockerfile to introduce 1) Proceed with installation (default) and avoid the error?

Thank you in advance

CodePudding user response:

use: curl https://sh.rustup.rs -sSf | sh -s -- -y

as mentioned here: https://github.com/rust-lang-deprecated/rustup.sh/issues/83

  • Related