0

I am trying to get some code into my docker container. One method I was looking into is using volumes. I am trying to hook my code into the containers generated by this project.

https://github.com/cloudera/clusterdock

Within the project, I added the line -v /Users/bi1/Development/QE/sink:/var/hostsrc \ into the file clusterdock.sh

sudo docker run --net=host -t \
      --privileged \
      ${TARGET_DIR_MOUNT} \
      ${TOPOLOGY_VOLUME} \
      ${REGISTRY_INSECURE} \
      ${REGISTRY_USERNAME} \
      ${REGISTRY_PASSWORD} \
      -v /tmp/clusterdock \
      -v /etc/hosts:/etc/hosts \
      -v /etc/localtime:/etc/localtime \
      -v /var/run/docker.sock:/var/run/docker.sock \
      -v /Users/bi1/Development/QE/sink:/var/hostsrc \
      "${CLUSTERDOCK_IMAGE}" $@

  if [ -n "${TOPOLOGY_CONTAINER_ID}" ]; then
    sudo docker rm -v "${TOPOLOGY_CONTAINER_ID}" &> /dev/null
  fi
}

When I run docker inspect {containerId}

I see

...
"Mounts": [
            {
                "Type": "bind",
                "Source": "/etc/localtime",
                "Destination": "/etc/localtime",
                "Mode": "rw",
                "RW": true,
                "Propagation": ""
            }
        ],
...

How come even though I created a volume I can't see it when I inspect? Are my containers even linked to these volumes?

Liondancer
  • 15,721
  • 51
  • 149
  • 255
  • Are you sure that docker run command executed? If you kick your script of again, does the container id change? – BMitch Feb 22 '17 at 03:55

1 Answers1

0

Adding volumes in that way mounts them into the container that runs clusterdock itself, but not into the containers of the cluster nodes. There is no existing way to mount volumes into particular container nodes (though you can open an issue on the project's GitHub requesting it).

Dima Spivak
  • 747
  • 7
  • 9