I have an env variable value like this: TEST_VAR=The value
TEST_VAR=The value
Do anybody knowns whether this is legal? should I place \" around the value
\"
You can escape the space with a \:
\
TEST_VAR=The\ value
Edit: This is how I pass them when starting the container (i.e. docker run -e TEST_VAR=The\ value hello-world). If you're using docker-compose or an env file, see the answer by @yamenk.
docker run -e TEST_VAR=The\ value hello-world
docker-compose