简体   繁体   English

如何从现有映像构建Docker容器

[英]How to build Docker container from existing image

如何编辑docker compose,以便它使用现有图像来构建容器而不是在现场构建图像?

Turns out docker-compose up does the trick. 事实证明, docker-compose up可以解决问题。 Previously was using docker compose up --build which build the images even when not needed. 以前使用docker compose up --build即使不需要时也可以构建映像。

In docker-compose file mention your existing image from the image registry. 在docker-compose文件中,从映像注册表中提及您现有的映像。 docker-compose up will build the existing image. docker-compose up将构建现有映像。 This is basic functionality. 这是基本功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM