Can you use a .env file for a stand-alone Dockerfile?

前端 未结 4 1105
说谎
说谎 2020-12-25 11:29

I am working on a simple Docker image that has a large number of environment variables. Are you able to import an environment variable file like with docker-compose? I canno

4条回答
  •  梦谈多话
    2020-12-25 11:56

    If you need environment variables runtime, it's easiest to create a launcher script that sets up the environment with multiple export statements and then launches your process.

    If you need them build time, have a look at the ARG and ENV statements. You'll need one per variable.

提交回复
热议问题