Configuring a Docker (Env) container environment through a remote api device api

I am using dockerode to control docker using a remote api. Everything works fine, except that I cannot figure out how to set up the environment when I create the container.

The docker document does not provide any information about the format of the Env message parameters.

I tried {Env: ["foo = bar", "fii: boo"], ...} {Env: {"foo": "bar", "fii": "boo"}, ...} without success .

Does anyone know how to achieve this?

+4
source share
1 answer

The correct format is:

"Env":["KEY=value", "ANOTHER=value"]

If it does not work for you, there may be another problem.

+4
source

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


All Articles