DockerToolBox file mounting implementation code

DockerToolBox file mounting implementation code

When using docker, you may find that the file cannot be mounted. This is related to the shared folder settings of the virtual machine, and you must pay attention to certain things when setting it up. Otherwise, even if the shared folder is set up, it cannot be mounted.

First, open Oracle VM VirtualBox, select the default virtual machine, right-click to open the settings interface (as shown in the figure), and select the shared folder. Set up as follows:

Enter this command in cmd, which corresponds to the first shared folder

docker run -v /c/Users/test:/test -t -i ubuntu /bin/bash

Look at this one again, it corresponds to the second shared folder

docker run -v /code/test:/test -t -i ubuntu /bin/bash

It can be seen that c/Users in the directory after -v is the name of the shared folder. This means that when you write the directory to be mounted, you need to replace the real directory with the name of the shared folder. You cannot write it as docker run -v /e/file/AICS/code/test:/test -t -i ubuntu /bin/bash, otherwise it will not be mounted.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of how to mount local directories on Docker and implement file sharing
  • Detailed explanation of how to mount the file system in a running Docker container

<<:  How to use Javascript to generate smooth curves

>>:  MySQL 5.7.18 zip version installation tutorial

Recommend

How to query the intersection of time periods in Mysql

Mysql query time period intersection Usage scenar...

Three Ways to Find the Longest Word in a String in JavaScript (Recommended)

This article is based on the Free Code Camp Basic...

Description of the execution mechanisms of static pages and dynamic pages

1. A static page means that there are only HTML ta...

JavaScript timer to achieve limited time flash sale function

This article shares the specific code of JavaScri...

How to use jsx syntax correctly in vue

Table of contents Preface Virtual DOM What is Vir...

Detailed explanation of JavaScript Reduce

Table of contents map filter some every findIndex...

js learning notes: class, super and extends keywords

Table of contents Preface 1. Create objects befor...

Detailed explanation of CSS weight value (cascading) examples

•There are many selectors in CSS. What will happe...

How to import, register and use components in batches in Vue

Preface Components are something we use very ofte...

MySQL 8.0.2 offline installation and configuration method graphic tutorial

The offline installation method of MySQL_8.0.2 is...

How to operate Linux file and folder permissions

Linux file permissions First, let's check the...

How to add fields and comments to a table in sql

1. Add fields: alter table table name ADD field n...

Solve the problem that Mysql5.7.17 fails to install and start under Windows

Install MySQL for the first time on your machine....

In IIS 7.5, HTML supports the include function like SHTML (add module mapping)

When I first started, I found a lot of errors. In...

Util module in node.js tutorial example detailed explanation

Table of contents Starting from type judgment Str...