国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

dockerfile - docker-compose每次up之后,之前在容器中所做的修改保不保留?
世界只因有你
世界只因有你 2017-04-27 09:02:11
0
2
1376

我測(cè)試的是保留的,比如我在mysql鏡像數(shù)據(jù)庫(kù)里新建了一個(gè)表,
重新docker-compose up以后,之前的表還存在,
不過(guò)沒(méi)法理解啊,難道docker-compose up不是重新生成了鏡像的實(shí)例嗎?
每個(gè)docker-compose.yml其實(shí)只能生成一個(gè)實(shí)例?要reset的話(huà)必須手動(dòng)刪除之前的實(shí)例

世界只因有你
世界只因有你

reply all(2)
漂亮男人

docker-compose upPriority will be given to using existing containers instead of creating new ones.

The following method can solve your problem:

docker-compose up -d --force-recreate 使用 --force-recreate You can force the container to be rebuilt (otherwise the container will only be rebuilt when the container configuration changes)

docker-compose down Stop all containers and delete the container (so it will be a new container the next time you use docker-compose down 停止所有容器,并刪除容器 (這樣下次使用docker-compose up)

洪濤

docker-compose up is to create and start a container. As far as I know, there are only three situations where the container will be re-created (that is, the old container will be deleted first, and then a new one will be generated):
1. When the image is updated, the container will be re-created. Re-create the container;
2. The container does not exist (that is, it has been deleted);
3. When container A is re-created, the containers that depend on this container will be re-created (that is, the container in the docker-compose.yml file is set depends_on is the container of container A)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template