我更新了docker撰写文件。当我重建容器,似乎他们不重新启动。为什么?
在这里我们可以看到最后一步没有被缓存,新的图像被创建:
$ BUILDKIT_PROGRESS=plain docker compose --verbose -p bot -f docker-compose.yml -f docker-compose.dev.yml --env-file etc/db_env.conf up --detach --build
...
#16 [my-perl 12/12] COPY . .
#16 DONE 0.0s
#17 exporting to image
#17 exporting layers 0.0s done
DEBU[0001] stopping session
#17 writing image sha256:f64d73e7d5c5d5baa69df94dfc083bac08fd8395ae86e25204bad45d20007134 done
#17 naming to docker.io/library/bot_app done
#17 DONE 0.1s
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
[+] Running 2/0
⠿ Container bot-db-1 Running 0.0s
⠿ Container bot-app-1 Running
找到答案:https://github.com/docker/compose/issues/9259
这是一个错误,并在docker compose 2.6.1中修复。我的版本是2.3.3