复制码头码头容器进行调试 [英] Duplicating docker container for debugging
问题描述
我被困在一个地方。我不知道我是否在同一个容器中进行调试,我可能会放弃我在该容器内到目前为止所做的一切。
所以我想创建一个重复复制它与运行容器中可用的所有东西[像我不想从映像构建容器,并重复在运行容器中实现的所有有用步骤,然后启动我的调试。我不想在我的第二个容器中重新安装ping。]
总的来说,我如何复制容器?如果不是所有的可能性?
-
创建基本图像并运行
docker run -it< base_image> / bin / bash
-
进行必要的更改
yum install ping
-
提交它使用新名称
docker commit<运行容器的哈希标签> new_image
现在,如果您通过运行
docker run -it new_image / bin / bash
$打开new_image c $ c>
您可以在其中看到 ping
。
打开base_image,安装没有 ping
希望它回答你的问题。
I have a running docker container. I have done some useful works in the running docker container. I have done these works not part of dockerfile, i have done it inside the container.[Eg: I have installed ping inside the container, not from docker file]
Now, i got stuck at a place. I am not sure if i debug in the same container, i may loose the thing that i have done so far inside that container.
So i would like to create a duplicate copy of it with all the things available in that running container[like i don't want to build a container from image and repeat all the suucessful steps achieved in the running container and then start my debuggging. I don't want to re-install ping in my second container].
Totally, How can i duplicate a container? If not what are all the possibilities?
Create a base image and run it
docker run -it <base_image> /bin/bash
Make necessary changes
yum install ping
Commit it with a new name
docker commit <hash tag of running container> new_image
Now if you open new_image by running
docker run -it new_image /bin/bash
You can see ping
is installed in it.
Open base_image and there is no ping
installed in it.
Hope it answered your question.
这篇关于复制码头码头容器进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!