1

I am trying to create a 1-way or 2-way (inter-process communications) between the container / docker that runs through Marathon and the host computer For example:

in my host computer, I do export ENV_VARIABLE_TO_DOCKER_XYZ="1000.2000" (changes with run-time)

when I run a docker, can I ever poll to read that system variable during docker runtime?

Case no, I am happy for any other alternative (ioctl, shared memory, signal, etc) Except mounting a disk / mem area (this is clearly the easiest way through -v /xyz:docker_xyz) Thanks

  • 2
    You can define environment variables in your `docker run` command. See https://docs.docker.com/engine/reference/run/#env-environment-variables – Xiongbing Jin Mar 05 '16 at 23:44
  • When passing env vars in the docker run command, you won't see updates to the original env var (what I assume OP is looking for). You'd have to serialize them to disk, mount that file and read it to see updates. Or expose an port on your container that whatever is updating your hosts env var can ping with the new value - and have something in your ontainer listening for changes on that port. – iZ. Apr 22 '16 at 16:14

0 Answers0