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

后端 未结 6 1481
你的背包
你的背包 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条回答
  •  感动是毒
    2021-02-06 00:06

    • Ceate a .env file
     example: test=123 val=Guru
    
    • Execute command

    docker run -it --env-file=.env bash

    • Inside the bash verify using

    echo $test (should print 123)

提交回复
热议问题