Docker Toolbox Mounts host directory to container for proper operation under window home

Source: Internet
Author: User
Tags docker run docker toolbox

Since I am windows Home and not the Pro version, I can only use Docker Toolbox, in fact, the Docker for window has better support and the Gui,home version of Docker is also very hard to install. Fortunately I installed, but the daily use is more than the pro version of the Docker has more pits, here I stepped on the pit, recorded, benefiting others.

This pit is Docker Toolbox in window Home under the Mount host directory to the container, would like to think is to be in Docker for WIN10 Pro provide GUI set with C drive sharing, Google a lot of ways, Or in the Docker community, an old brother sharply pointed out that this is actually a grammatical error, echoing the link.

Source: Can ' t set Docker Volume for Container in Windows Docker ce-docker for Windows-docker Forums

When the Docker container starts, if you want to mount a directory for the host, you can specify it with the-v parameter.

For example, I want to start a CentOS container, the host's C:/users/t480s/work/engine directory is mounted to the container's/engine directory, which can be specified in the following ways:

Docker run-it-v c:/users/t480s/work/engine:/engine-p 8000:8000 Steveny/predictionio:0.12.0/bin/bash

This allows the container to automatically create a/engine directory after the container is started. In this way, we can make it clear that, in the-v argument, the colon ":" in front of the directory is the host directory, and the following directory is the directory inside the container.

Note: The container directory is not considered a relative path and the slash is a backslash '/'

But it's still an error.

Error: Error response from Daemon:invalid mode:/engine

Would like to think that in Docker for WIN10 Pro to provide GUI settings and C-disk sharing, Google a lot of ways, or in the Docker community, an elder brother sharply pointed out that this is actually a grammatical error, reference.

This is the code that was modified after referring to the error pointed out by others

8000:8000 Steveny/predictionio:0.12. 0 /bin/bash

No error, correct output

Docker Toolbox Mounts host directory to container for proper operation under window home

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.