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

Vue+js realizes video fade-in and fade-out effect

Vue+js realizes the fade in and fade out of the v...

How to clean up Alibaba Cloud MySQL space

Today I received a disk warning notification from...

The qualities and abilities a web designer should have

Web design is an emerging marginal industry that c...

How to build Jenkins+Maven+Git continuous integration environment on CentOS7

This article takes the deployment of Spring boot ...

jQuery implements sliding tab

This article example shares the specific code of ...

Causes and solutions to the garbled character set problem in MySQL database

Preface Sometimes when we view database data, we ...

Detailed explanation of software configuration using docker-compose in linux

Preface This article will share some docker-compo...

Parsing Linux source code epoll

Table of contents 1. Introduction 2. Simple epoll...

Summary of ways to implement single sign-on in Vue

The project has been suspended recently, and the ...

Mysql online recovery of undo table space actual combat record

1 Mysql5.6 1.1 Related parameters MySQL 5.6 adds ...

How to connect to MySQL database using Node-Red

To connect Node-red to the database (mysql), you ...

Getting Started Tutorial on GDB in Linux

Preface gdb is a very useful debugging tool under...

Share the 15 best HTML/CSS design and development frameworks

Professional web design is complex and time-consu...