InDockerfile
A is defined inenv
Variables, as follows:
...
ENV MY_ENV dev
CMD ["pm2","start", "pm2.json"," --env ${MY_ENV}","--no-daemon"]
...
Want to be in the mirrorRUN
When, putenv
Replace the variable with the specified one and write as follows:
docker run -e "MY_ENV=staging" --name pm2_test -p 3500:3500 -d pm2_test:v1
Q: Why do variables not work?
To do this
CMD pm2 start pm2.json --env ${MY_ENV} --no-daemon