Duplicating docker container for debugging

  1. Create a base image and run it

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

    yum install ping
    
  3. 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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)