Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the Docker's container environnement (Env) via the docker remote api

Tags:

docker

I'm using dockerode to manage docker by the remote api. Everything works fine except that I can't figure how to set the environnement when I create the container.

The docker doc doesn't give any information about the Env post parameter format.

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

Does anyone know how to achieve this ?

like image 788
regisg Avatar asked Oct 28 '25 13:10

regisg


1 Answers

The correct format is like:

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

If it isn't working for you there is probably another issue there.

like image 71
quinn Avatar answered Oct 30 '25 13:10

quinn