I'm using Alpine Linux in a container. I have
ENV PATH="~/.local/bin:$PATH" \ in my Dockerfile
When logging into the shell I can successfully
ls ~/.local/bin which is the same as
ls /root/.local/bin, the target binary is there.
However which I call the binary directly or
which mybin it won't work. After explicitly add
/root/.local/bin, then it works.
I'm not sure why is this happening, since
/root/.local/bin are the same.
Any ideas? Thanks!
The dup link gave me some idea of what was happening, but I found that wasn't the main cause. Removing quotes won't work still, as the Dockerfile
ENV directive does not do any shell expansion.
It seems the only viable way to do this is to use
export && in a
$HOME work in