----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/57846/#review169822 -----------------------------------------------------------
If you can't use the env file to pass task's env to the docker client, and can't prefix task's env var names to avoid collision with docker client's env vars, the only way to pass task's vars IIUC is to use `-e` flag and set *both* `name` and `value`. src/docker/docker.cpp Line 949 (original), 920-921 (patched) <https://reviews.apache.org/r/57846/#comment242471> This looks like a bug. `Subprocess` uses system env if `env` is not passed explicitly: https://github.com/apache/mesos/blob/b5ecabb152983a1376c1046d6e46685d58970d2c/3rdparty/libprocess/include/process/posix/subprocess.hpp#L223-L225 By setting it explicitly to _task's_ env, you might break things, e.g., consider `PATH` in task's env is different from `PATH` in `os::environment()`. - Alexander Rukletsov On March 22, 2017, 7:57 p.m., Till Toenshoff wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/57846/ > ----------------------------------------------------------- > > (Updated March 22, 2017, 7:57 p.m.) > > > Review request for mesos, Adam B, Alexander Rukletsov, Gilbert Song, James > DeFelice, Jie Yu, and Joseph Wu. > > > Bugs: MESOS-6951 > https://issues.apache.org/jira/browse/MESOS-6951 > > > Repository: mesos > > > Description > ------- > > see summary. > > > Diffs > ----- > > src/docker/docker.cpp 44fbde8e8a2c6c957af7339b4fb9479af7f21ff7 > > > Diff: https://reviews.apache.org/r/57846/diff/1/ > > > Testing > ------- > > make check & sudo ./bin/mesos-tests.sh > > Functional testing - running `ps` while docker test active to confirm we do > not leak values to the commandline; > > ``` > /usr/bin/docker-current -H unix:///var/run/docker.sock run --cpu-shares 1024 > --memory 536870912 -e MESOS_CONTAINER_NAME -e MESOS_SANDBOX -v > /tmp/DockerContainerizerTest_ROOT_DOCKER_KillOrphanContainers_r7ImX7:/mnt/mesos/sandbox > --net host > ``` > > Further functional testing on variables containing linefeeds in progress... > > > Thanks, > > Till Toenshoff > >
