当前位置:网站首页>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
边栏推荐
- Self supervised learning and drug discovery
- Numpy----np. reshape()
- MySQL interview question set
- Appium automation test foundation ADB common commands (I)
- Jenkins - Pipeline 概念及创建方式
- To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine
- Numpy----np.tile()函数解析
- Learn pickle
- Machine learning notes - time series as features
- Take n multiple table names of a database as the values of a column in another table (the range can be a table in another database)
猜你喜欢

Jenkins - accédez à la variable de paramètre personnalisée Jenkins, en traitant les espaces dans la valeur de la variable

Differences between cesium polygon extrudedheight and height

Using redis bitmap to realize personnel online monitoring

Jenkins - data sharing and transfer between copy artifact plug-in builds

声网 VQA:将实时互动中未知的视频画质用户主观体验变可知

Figure out the difference between MIT, BSD and Apache open source protocols
![[Niuke discussion area] Chapter 4: redis](/img/53/f8628c65890f1c68cedab9008c1b84.png)
[Niuke discussion area] Chapter 4: redis

Database query optimization: master-slave read-write separation and common problems

Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)

Jenkins - Groovy Postbuild 插件丰富 Build History 信息
随机推荐
[Yocto RM] 4 - Source Directory Structure
解决ionic4 使用hammerjs手势 press 事件,页面无法滚动问题
Jenkins - 邮件通知 Email Notification 插件
面试官问:能否模拟实现JS的new操作符
MySQL interview question set
pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...
Using redis bitmap to realize personnel online monitoring
Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
How to study efficiently
要搞清楚什么是同步,异步,串行,并行,并发,进程,线程,协程
[Niuke discussion area] Chapter 4: redis
Intranet penetration with FRP
Numpy----np. Tile() function parsing
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
Cesium 获取屏幕所在经纬度范围
Prometeus 2.35.0 new features
Review of drug discovery-03-molecular design and optimization
[Yocto RM]8 - OpenEmbedded Kickstart (.wks) Reference
利用redis bitmap实现人员在线情况监控
geojson 格式说明(格式详解)