I'm installing Poetry in a dockerfile, but I want to do it under a different user (to play nicely with VSCode). I don't understand the behavior of the su
command though.
When I run su vscode -c "echo $HOME"
I get /root
. However, when I run su vscode
, and subsequently run echo $HOME
, I get /home/vscode`.
Even stranger, when I run su vscode -c "echo $HOME && curl -sSL https://install.python-poetry.org | python3"
, I get /root
as output of the first command, but poetry is installed to /home/vscode/.local/bin
. I'm at a loss here... can someone shine some light on this?