当前位置:网站首页>Anonymous Mount & named mount
Anonymous Mount & named mount
2022-06-28 02:23:00 【Late stage big face sprouting of lazy cancer】
# Mount anonymously
-v Container path
[[email protected] volumes]# docker run -d -P --name nginx02 -v /ect/nginx nginx # -P Random port
1e7a6f078e1d149a28870b080e8889fa943c0a3be94cb98b34e4b68fbaca7706
[[email protected] volumes]# docker volume --help
Usage: docker volume COMMAND
Manage volumes
Commands:
create Create a volume
inspect Display detailed information on one or more volumes
ls List volumes
prune Remove all unused local volumes
rm Remove one or more volumes
Run 'docker volume COMMAND --help' for more information on a command.
# View all volume situation
[[email protected] volumes]# docker volume ls # The following are all anonymous volume mounts , stay -v Only the path in the container is written , No path outside the container is written
DRIVER VOLUME NAME
local 85ceb1c90bf20638336243eba9185d8f733c19785e70699e95511e5022167d41
local 378d3ad8f128323116b58484f5fd19492b4e41d1213f729ed89cfc9c7f3524bc
local 94004da9bc144582354a4fa694fc647b7d700512eb1d0b220f47de9a521da753
local 40506974fbded9e29a84f42f33b737e28dc13eb0a821f1ebd991aa349bfac1bc
local aaac05064af330ebf935a3c42bf51f49aa82f319714b9e865fed5f875ee885ef
local c2956de8052af73afc7e00ebdc74f9a2f17e8f794bf551ce09fd45598e58c94f
# View where the volume is located :Mountpoint
[[email protected] ~]# docker volume inspect 85ceb1c90bf20638336243eba9185d8f733c19785e70699e95511e5022167d41
[
{
"CreatedAt": "2022-05-06T13:29:50+08:00",
"Driver": "local",
"Labels": null,
"Mountpoint": "/var/lib/docker/volumes/85ceb1c90bf20638336243eba9185d8f733c19785e70699e95511e5022167d41/_data",
"Name": "85ceb1c90bf20638336243eba9185d8f733c19785e70699e95511e5022167d41",
"Options": null,
"Scope": "local"
}
]# Mount with a name
-v Volume name : Container path
[[email protected] ~]# docker run -d -P --name nginx03 -v juming-nginx:/etc/nginx nginx
f89ab2645fc6cea48003e98d080b37d5aa5d3485740ee1d34df128c4872edcef
[[email protected] ~]# docker volume ls
DRIVER VOLUME NAME
local 2eba47cade6c5b68f4f2179df0511e49113f4c507aad448b2bc25fbb99cc4ecf
local 5f5d46c0cfe40408f71515d12b6d2bab31cfbe478716f125bab34d43c65e0776
local 54c20bfffe906d311d4394dccb85c4f7f2d2cee4ed295ff9682856a7c2a7d07b
local 85ceb1c90bf20638336243eba9185d8f733c19785e70699e95511e5022167d41
local 378d3ad8f128323116b58484f5fd19492b4e41d1213f729ed89cfc9c7f3524bc
local 94004da9bc144582354a4fa694fc647b7d700512eb1d0b220f47de9a521da753
local 40506974fbded9e29a84f42f33b737e28dc13eb0a821f1ebd991aa349bfac1bc
local aaac05064af330ebf935a3c42bf51f49aa82f319714b9e865fed5f875ee885ef
local c2956de8052af73afc7e00ebdc74f9a2f17e8f794bf551ce09fd45598e58c94f
local ccd77d73028a70a3433a374aea57d9e2c96828cddefe1a808eda0354ba3b7a44
local juming-nginx
[[email protected] ~]# docker volume inspect juming-nginx
[
{
"CreatedAt": "2022-05-29T14:43:14+08:00",
"Driver": "local",
"Labels": null,
"Mountpoint": "/var/lib/docker/volumes/juming-nginx/_data",
"Name": "juming-nginx",
"Options": null,
"Scope": "local"
}
]
all docker The volume in the container , No directory specified ( You can use docker info Command view Directory ) In the case of..., the default is /var/lib/docker/volumes/xxx/_data Under the table of contents


We can easily find the volume through the named mount , In most cases, a named mount is used
-v / Container path # Mount anonymously
-v Volume name :/ Container path # Mount with a name
-v / Host path :/ Container path # Specify the path to mount , This method does not produce anonymous volumes
expand
# adopt -v Container path :ro rw Change read and write permissions
ro readonly -- read-only
rw readwrite -- Can read but write
docker run -d -P --name nginx03 -v juming-nginx:/etc/nginx:ro nginx
# Just see ro This means that this path can only be operated by the host , The container cannot be cleaned , The default is rw
边栏推荐
- Cesium Click to obtain longitude and latitude (2D coordinates)
- Jenkins - groovy postbuild plug-in enriches build history information
- JS 数组随机取值(随机数组取值)
- 【sylixos】NEW_ Example of type 1 character drive
- [embedded foundation] serial port communication
- pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...
- pytorch_ lightning. utilities. exceptions. MisconfigurationException: You requested GPUs: [1] But...
- mysql面试百题集
- Geojson format description (detailed format)
- geojson 格式说明(格式详解)
猜你喜欢
![pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...](/img/b4/8921c3ca5cd5a547768489d4a79202.png)
pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...

Using redis bitmap to realize personnel online monitoring

Cesium 多边形(polygon)extrudedHeight 和 height 的区别

Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)

机器学习笔记 - 时间序列作为特征

面试官问:能否模拟实现JS的new操作符

Jenkins - 内置变量访问

The interviewer asked: can you simulate the new operator of JS

类的初始化与回调的用法

Database query optimization: master-slave read-write separation and common problems
随机推荐
Evaluation - rank sum ratio comprehensive evaluation
pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...
面试官问:能否模拟实现JS的new操作符
Coscon'22 lecturer solicitation order
geojson 格式說明(格式詳解)
一张图弄懂 MIT,BSD,Apache几种开源协议之间的区别
[Yocto RM] 2 - Yocto Project Terms
Cesium Click to obtain longitude and latitude (2D coordinates)
[embedded foundation] memory (cache, ram, ROM, flash)
SQL 注入绕过(五)
Jenkins - Pipeline 语法
What are the risks of opening a compass stock account? Is it safe to open a compass account
利用redis bitmap实现人员在线情况监控
Jenkins - 訪問 Jenkins 自定義參數變量,處理變量值中含有空格
Adobe Premiere foundation - sound adjustment (volume correction, noise reduction, telephone tone, pitch shifter, parameter equalizer) (XVIII)
外盘期货哪里可以开户?哪个平台出入金比较安全?
Using redis bitmap to realize personnel online monitoring
Database query optimization: master-slave read-write separation and common problems
Cesium Click to draw polygons (dynamically draw polygons)
引用层reboot后的大体流程