Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/bin/sh: 1: cargo: not found #32

Open
ppdogg opened this issue Apr 7, 2022 · 2 comments
Open

/bin/sh: 1: cargo: not found #32

ppdogg opened this issue Apr 7, 2022 · 2 comments

Comments

@ppdogg
Copy link

ppdogg commented Apr 7, 2022

I was building the project in ssh connected to a remote virtual machine.
when I execute make, the error comes with:

/bin/sh: 1: cargo: not found

I look it up and found this solution works for me: https://stackoverflow.com/questions/49676490/when-installing-rust-toolchain-in-docker-bash-source-command-doesnt-work

I made these changes in toda/Dockerfile:

  • change sh to bash
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- --default-toolchain nightly-2021-12-23 -y
  • modify ENV grammer
ENV PATH="/root/.cargo/bin:${PATH}"

However, in my own computer, which is mac os, I build this project successfully without changing anything. I believe remote virtual machine might encounter this problem.

@YangKeao
Copy link
Member

YangKeao commented Apr 7, 2022

I don't think these modification is needed.

For the first, https://rustup.rs/ told me it supports the sh.

For the second, see the "Alternative syntax" in https://docs.docker.com/engine/reference/builder/#env (though, I agree that including the "=" is better 🤦‍♂️ )

As the Dockerfile are executed inside a container, I don't think there are any difference between a mac os and a virtual machine (actually, the docker will run a virtual machine for mac os).

I guess there were some network issues, which cause the rustup script somehow failed to install the rustc, cargo, etc but doesn't return the error. I'm not sure.

@ppdogg
Copy link
Author

ppdogg commented Apr 8, 2022

I agree that building a docker image has nothing to do with host os, but that's the part that confused me.
I believe the error comes from either a modified centos or a rust installation problem. thanks for replying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants