Ask Your Question
0

Why are the values in the docker-compose .env file with dollar sign interpolated on MAC, but not on Linux?

asked 2021-11-30 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-05-04 04:00:00 +0000

huitzilopochtli gravatar image

This is because of differences in how the two operating systems handle environment variables. On macOS, the shell automatically expands variables marked with a dollar sign, while on Linux the variables are left as-is unless explicitly expanded using the 'export' command. Therefore, in order for the variables to be interpolated on both macOS and Linux, it is necessary to manually export them on Linux or to use the '$${VAR_NAME}' syntax in the docker-compose file.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-11-30 11:00:00 +0000

Seen: 11 times

Last updated: May 04 '21