Method and device for mounting host directory into container environment

A host and container technology, applied in the computer field, can solve problems such as failure to use normally, unable to obtain key information for diagnosing problems, unable to mount the host directory for containers, etc.

Inactive Publication Date: 2020-03-17
北京宝兰德软件股份有限公司
View PDF2 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] Among them, the docker cp solution cannot be used normally in extreme cases where the docker service hangs and basic docker commands are unavailable, resulting in failure to obtain key information for diagnosing the problem
[0004] In addition, the docker run solution can only mount the host directory for the container when the

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for mounting host directory into container environment
  • Method and device for mounting host directory into container environment
  • Method and device for mounting host directory into container environment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0023] figure 1 It is a flow chart of a method for mounting a directory of a host computer into a container environment provided by an embodiment of the present invention. Such as figure 1 As shown, the method includes: step 101, obtaining the physical disk device information on the host computer; step 102, obtaining the process number of the in...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention provides a method and device for mounting a host directory into a container environment, and the method comprises the steps: obtaining physical disk equipment information on the host and a process number of an internal process of a running container on the host machine, and entering the container environment according to the process number; creating corresponding virtual disk equipment information in the container based on the physical disk equipment information; mounting the virtual disk equipment information under a temporary directory in the container to realize that the temporary directory covers the directory information of the host machine; and mounting the host directory information under the temporary directory to the container directory to mount thehost directory to the container environment. The embodiment of the invention provides a method and equipment for mounting a host directory into a container environment, the host catalogue is mapped to the container catalogue when the containers are operated, stable operation can be achieved under the conditions that docker services are suspended and the like, and convenience is provided for sharing file information between different containers on the same host and between the host machines and the containers.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a method and device for mounting a directory of a host computer into a container environment. Background technique [0002] In the current mainstream container implementation scheme, when starting a new container, the host directory can be mounted to the container environment through the directory mount parameter dockerrun-v / hostpath: / containerpath imagename; it can also be installed on the host computer through docker cp Copy file directories to and from containers. [0003] Among them, the docker cp solution cannot be used normally in extreme cases where the docker service hangs and basic docker commands are unavailable, resulting in failure to obtain key information for diagnosing the problem. [0004] In addition, the docker run solution can only mount the host directory for the container when the container is created and started, and cannot mount the host directory for th...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F16/176G06F16/10
CPCG06F16/176G06F16/10
Inventor 易存道
Owner 北京宝兰德软件股份有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products