docker change container command code example
Example 1: how to rename a docker container
/*it does not restart the container */
docker container rename [old name] [new name]
Example 2: rename a running docker container
$ sudo docker rename discourse_app disc_app
Example 3: commit container to image
sudo docker commit [CONTAINER_ID] [new_image_name]
Example 4: docker commit
docker commit CONTAINER_ID CONTAINER_NAME:TAG