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

Mysql modify stored procedure related permissions issue

When using MySQL database, you often encounter su...

Example of usage of keep-alive component in Vue

Problem description (what is keep-alive) keep-ali...

Summary of Problems in Installation and Usage of MySQL 5.7.19 Winx64 ZIP Archive

Today I learned to install MySQL, and some proble...

Detailed explanation of jQuery method attributes

Table of contents 1. Introduction to jQuery 2. jQ...

Solution to the failure of entering the container due to full docker space

Since the problem occurred rather suddenly and th...

How to skip errors in mysql master-slave replication

1. Traditional binlog master-slave replication, s...

A brief discussion on VUE uni-app's commonly used APIs

Table of contents 1. Routing and page jump 2. Int...

JavaScript function call, apply and bind method case study

Summarize 1. Similarities Both can change the int...

MySQL data table partitioning strategy and advantages and disadvantages analysis

Table of contents Why do we need partitions? Part...

Solution to "No input file specified" in nginx+php

Today, the error "No input file specified&qu...

css3 animation ball rolling js control animation pause

CSS3 can create animations, which can replace man...

Image scrolling effect made with CSS3

Achieve resultsImplementation Code html <base ...

How to get the size of a Linux system directory using the du command

Anyone who has used the Linux system should know ...