Let’s assume you are running a docker image and you want to back up the image so it can be restored later or used to kick up a live website or database in the current state.
The steps are:
1) Login to your docker repository.
2) COMMIT your container (creates an image with the name you give it)
3) PUSH your image (push the image to your repository)
1) Login (requires that you have setup Docker to connect to your remote repository)
> docker login (follow the prompts to enter your username and password)
2) COMMIT your container:
docker commit -p [ContainerID] [dockerRepoositoryAccount]/[dockerRepoName]:[tag]
> docker commit -p 68d62922390e mtalcott/pm-sql:v010
Now you can look at your docker images and see that new commit should be at the top of the list using:
> docker images
3) Now PUSH your image to your remote repository:
(note that you don’t need to specify the tag when pushing. It is going to push all tags for this repo
> docker push mtalcott/pm-sql
You can now login to your Docker hub UI and verify that this tag is listed in your repo.