How to Commit Changes and Create Docker Images

Commit Changes to Docker

To create a new image from changes to a container, it’s a simple as running just one command. Before we do so, however, let’s change the container!

Within this container we are free to do anything we would typically do on Fedora. In this case, we’re going to install Gitand then commit the container.

Once you’ve completed those instructions you can disconnect, or detach, from the shell without exiting use the escape sequence Ctrl-p + Ctrl-q.

Finally it’s time to commit our changes to a named image. This command converts the container 9c09acd48a25 to an image with the name fedora-base-with-git:

docker commit 9c09acd48a25 fedora-base-with-git


Docker uses the “commits are cheap” concept in its design. You’re encouraged to commit frequently and at any point in an image’s history, much like version control.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Remove a MySQL User on Linux via Command Line

Login to MySQL First we’ll login to the MySQL server from the command line with the...

Error: 500 OOPS: vsftpd: refusing to run with writable root inside chroot() [SOLVED]

The Fix This error may occur when attempting to connect to a vsftpd FTP server that is...

How to Install Pip on Ubuntu 14.04 LTS

Pip is a tool for installing and managing Python packages. Python is a programming language. It...

How to Upgrade MySQL 5.1 to MariaDB 10.0 on CentOS 6

Step #1: Upgrade from MySQL 5.1 to MariaDB 5.5 The proper upgrade path from MySQL 5.1 to MariaDB...

How to Install Logwatch on CentOS 6

Logwatch is a Perl-based log management tool for analyzing, summarizing, and reporting on a...

Powered by WHMCompleteSolution