Cannot create new Rust project with Docker: “could not determine the current user”


Cannot create new Rust project with Docker: “could not determine the current user”



Following the Docker documentation for Rust, I can't create a new project using cargo new without getting could not determine the current user, please set $USER. Here's the command I'm using:


cargo new


could not determine the current user, please set $USER


docker run -it --rm -v "$PWD":/app -w /app rust:1.27.0-slim-stretch cargo new project --bin




1 Answer
1



Forwarding the $USER environment variable from my machine seems to do the trick:


$USER


docker run -it --rm -e USER=$USER -v "$PWD":/app -w /app rust:1.27.0-slim-stretch cargo new project --bin






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?