Workaround to docker run “--env-file” supplied file not being evaluated as expected

后端 未结 6 1435
你的背包
你的背包 2021-02-05 23:58

My current setup for running a docker container is on the lines of this:

  1. I\'ve got a main.env file:
# Main
export PRIVATE_IP=\\`echo          


        
6条回答
  •  萌比男神i
    2021-02-06 00:03

    I had a very similar problem to this. If I passed the contents of the env file to docker as separate -e directives then everything ran fine however if I passed the file using --env-file the container failed to run properly.

    Turns out there were some spurious line endings in the file (I had copied from windows and ran docker in Ubuntu). When I removed them the container ran the same with --env or --env-file.

提交回复
热议问题