gpt4 book ai didi

docker - 手动安装后可以在docker中保存吗?

转载 作者:行者123 更新时间:2023-12-02 18:29:51 24 4
gpt4 key购买 nike

我想知道在docker中是否可行?如何?

我使用最小的Dockerfile创建了最小的镜像。

然后,我以交互方式“运行”此图像并获得一个cmd窗口(或 shell )。

现在,我想执行一些不需要在Dockerfile中编写代码的手动安装。

完成后,我想将其保存为新图像,或者直接保存在我在“运行”时开始使用的原始图像上
谢谢

最佳答案

您可以使用docker container commit将容器保存在新图像中

docker container commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

来自文档的描述:

Create a new image from a container’s changes

关于docker - 手动安装后可以在docker中保存吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50825502/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com