Reputation: 6595
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:
docker run -it --rm -v "$PWD":/app -w /app rust:1.27.0-slim-stretch cargo new project --bin
Upvotes: 6
Views: 2587
Reputation: 3956
If you need to fix this inside the container, run:
$ export USER=yourname
Upvotes: 2
Reputation: 6595
Forwarding the $USER
environment variable from my machine seems to do the trick:
docker run -it --rm -e USER=$USER -v "$PWD":/app -w /app rust:1.27.0-slim-stretch cargo new project --bin
Upvotes: 12