Skip to content

docker_commit_changes

M1chaelM edited this page Dec 2, 2020 · 6 revisions

Commit Changes

You have now made some improvements to your container environment. The next step is to commit them back to the image.

  • Run exit in the interactive shell to leave the container.
  • Run docker ps -a to list all containers. You should see your container named my_container.
  • Copy the Container ID of my_container.
  • Run
docker commit -m "Start off ros-melodic-base, add run_my_system simple script" -a "<FULL NAME>" <Container_ID> <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG>

Notes:

  • Your username must match the username of your Dockerhub account.
  • The image repository name is the repository name that the image will be saved to on Dockerhub.
  • The tag and colon are optional (but highly recommended) to help you version your images.

Example:

docker commit -m "Start off ros-melodic-base, add run_my_system simple script" -a "Tyler Lum" a0e1e92cb6a5 tylerlum/vorc-competitor-example:v2.2020

Test

The command above should have created a new image from your original. To make sure this worked, run

docker image ls

and verify that your new container is listed.

Previous: Modify the Container Environment Up: Development Process Overview Next: Repeat