Host readiness

Currently, using Boot2Docker on Windows, is it possible to install root on a host? Say I use an Ubuntu image and I would like to install / on the host, how can I do this?

I looked around and tried:

docker run -v /c/Users/ubuntu:/ --name ubuntu -dt ubuntu

but ended up with an error:

docker: Error response from daemon: Invalid bind mount spec "/c/Users/ubuntu:/": volumeslash: Invalid specification: destination can't be '/' in '/c/Users/Leon/ubuntu:/'.

+6
source share
2 answers

If I understand correctly, are you trying to set root inside the container as a volume? If so, rather create a new directory inside and expose it.

For example, dockerfile:

 RUN mkdir /something VOLUME /something 

According to the docker documentation, the container directory should always be an absolute path, such as / src / docs. Host-dir can be an absolute path or value of a name.

For more information, read the following: https://docs.docker.com/engine/userguide/containers/dockervolumes/#mount-a-host-directory-as-a-data-volume and the part "Set host directory as volume data "should give you a better understanding.

+3
source

This is a problem with the way you indicate the path. An example of mounting a local volume for a container for mongo db:

docker run --name container-name -v / Users / SKausha3 / mongo / imageservicedb / data strong>: / data -v / Users / SKausha3 / mongo / imageservicedb / backup : / backup

c: / Users / SKausha3 / mongo / imageservicedb / data is my local folder, but you need to remove "c:" from the path.

+2
source

All Articles