Docker application packaging that can be configured at runtime

I packaged a web application that I worked on as an image docker.

I want to be able to run the image with some configuration, for example, this is the couchdb server url to use, etc.

What is the best way to configure? My application relies on env variables, can I set them at runtime?

+4
source share
2 answers

In addition to setting environment variables during docker run(using -e/ --envand --env-file), as you already discovered, there are other options available:

  • --link, couchdb (). , ( ). , IP- , script. , .

  • . , Docker, , , . .

  • . ADD ENV. , , , (, / , , - dev/production). .

+4

, env - !

docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash

http://docs.docker.com/reference/commandline/cli/#run

+2

Source: https://habr.com/ru/post/1546821/


All Articles