Tobias Pfeiffer created MESOS-6048:
--------------------------------------

             Summary: Docker execution fails if agent's workdir is a relative 
path
                 Key: MESOS-6048
                 URL: https://issues.apache.org/jira/browse/MESOS-6048
             Project: Mesos
          Issue Type: Bug
    Affects Versions: 1.0.0
         Environment: openSUSE Tumbleweed, Docker 1.11.2
            Reporter: Tobias Pfeiffer
            Priority: Minor


I start my mesos-agent.sh for development purposes like

{code}
sudo ./bin/mesos-agent.sh --master=127.0.0.1:5050 \
  --work_dir=../../tmp --containerizers=docker \
  --no-systemd_enable_support
{code}

And when executing a task via the Python API like

{code}
task.command.value = "echo foobar; hostname"
task.container.type = 1 # docker
task.container.docker.image = "phusion/baseimage:0.9.19"
{code}

then this fails with the following error message:

{noformat}
I0816 17:04:48.799820  9105 docker.cpp:809] Running docker -H 
unix:///var/run/docker.sock run --cpu-shares 1024 --memory 1234567 -e 
MESOS_SANDBOX=/mnt/mesos/sandbox -e 
MESOS_CONTAINER_NAME=mesos-bc638eef-caf2-4778-a762-58826ea40364-S3.8386e2e0-6f40-47e2-9022-069b9f52b051
 -v 
../../tmp/slaves/bc638eef-caf2-4778-a762-58826ea40364-S3/frameworks/bc638eef-caf2-4778-a762-58826ea40364-0011/executors/0/runs/8386e2e0-6f40-47e2-9022-069b9f52b051:/mnt/mesos/sandbox
 --net host --entrypoint /bin/sh --name 
mesos-bc638eef-caf2-4778-a762-58826ea40364-S3.8386e2e0-6f40-47e2-9022-069b9f52b051
 phusion/baseimage:0.9.19 -c echo foobar; hostname
docker: Error response from daemon: create 
../../tmp/slaves/bc638eef-caf2-4778-a762-58826ea40364-S3/frameworks/bc638eef-caf2-4778-a762-58826ea40364-0011/executors/0/runs/8386e2e0-6f40-47e2-9022-069b9f52b051:
 
"../../tmp/slaves/bc638eef-caf2-4778-a762-58826ea40364-S3/frameworks/bc638eef-caf2-4778-a762-58826ea40364-0011/executors/0/runs/8386e2e0-6f40-47e2-9022-069b9f52b051"
 includes invalid characters for a local volume name, only 
"[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed.
{noformat}

In short: Relative paths are not allowed for mounting host directories into 
Docker containers. I suggest that the agent should turn the work directory into 
an abspath before passing it to the `-v` parameter of docker.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to