Duplicating docker container for debugging

后端 未结 5 568
遥遥无期
遥遥无期 2020-12-14 14:48

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 c

5条回答
  •  天涯浪人
    2020-12-14 15:31

    1. Create a base image and run it

      docker run -it  /bin/bash
      
    2. Make necessary changes

      yum install ping
      
    3. Commit it with a new name

      docker commit  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.

提交回复
热议问题