6

docker volumes

 2 years ago
source link: https://xmetal.cc/?p=2062
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

volumes

volumes 有两种形式

1 宿主机路径(HOST:CONTAINER)

volumes:

 - ~/configs:/etc/configs/:ro #host:container

2 数据卷名称(VOLUME:CONTAINER)

匿名卷即没有显示指定名字的卷,实名卷具有名字,两种卷均存储在/var/lib/docker/volumes/区域,匿名卷的目录名是一串数字,如果在创建容器是添加了-rm参数,则匿名卷会随着容器的删除而删除

volumes:
 - /var/lib/mysql  #匿名
 - db:/var/lib/mysql #VOLUME:container

Post navigation

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK