2021-02-27

How to add cargo (or any executable) to path in Dockerfile for subsequent build steps?

I have the following snippet in my Dockerfile:

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN USER=root cargo new --bin foobar

The problem is, the 2nd RUN fails because cargo is not in the path.

Is there a way to fix this?

I've tried setting the path like this (inspired by this answer):

ENV PATH $HOME/.cargo/.bin:$PATH

but this doesn't seem to do the trick



from Recent Questions - Stack Overflow https://ift.tt/3sJEH7R
https://ift.tt/eA8V8J

No comments:

Post a Comment