Application Scenarios
The project team now changes the release plan to release the package entirely in the form of a Docker mirror. This can be:
• Go to operating system and operation Environment dependence
• Facilitates the continuous integration of software release processes
• Efficiently speed up release and validation
In this way, when the image is released, the file system of the software needs to be added to the mirror, that is, the transmission of the file system is involved. After searching on the internet, we found that there are many ways to achieve this, and now we use the easiest and easiest way to do it.
The host machine's files are transferred to the container
STEP1: First create a new "trans_file.txt" file in the/home/directory in the container dc1c56b06f2f and write the contents of the file:
#This is a test file to show file translation from
#container to its host
#So, here we go ...
STEP2: Create a new terminal and type the command "sudo docker cp dc1c56b06f2f:/home/trans_file.txt/home"
STEP3: View the file on the host machine for replication OK.
The files in the container are transferred to the host machine
STEP1: First create a new "Test0504.txt" file on the host machine and write the contents:
#This is a test file to show example of translation file (s)
#between host and container.
#So, here we are go!
STEP2: Use parameter "-V" to implement file Mount function: "Docker run–i–t-v/home/:/home/ahailun/test:ubuntu15.10.py/bin/bash", this command is to the host machine directory/home/ The table of contents (the part before the colon) is mounted under the/home/(the part after the colon) in the container.
STEP3: You can see, the container in the/home/directory of the file has been successfully mounted, in the container can be in time CP out.