I’m working with a Jetson NX (Ubuntu 18.04) running Docker version 20.10.2 and docker-compose v2.15.1. When attempting to include environment variables in the docker-compose file I’m using a .env file for hardcoded values, and attempting to pull the USER environment variable in:
volumes:
- /home/${USER}/:/home/${USER}/
using:
USER=${USER} docker-compose up --build --force-recreate
This approach works on my Ubuntu Linux laptop, but not on the Jetson NX.
Why might this be?
Could you share what kind of global environment you try to set?
We usually use the same way to set the DISPLAY variable and it can work within the container.
I wanted to set the $USER variable to be the same as my user. In the end I didn’t need to and could just use a relative path in my docker for my file output location. thanks anyway