Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Managing Docker images

jlgrock edited this page Dec 31, 2014 · 2 revisions

There are a number of actions that can be made on Docker images that can be used on a general basis. This is not an exhaustive list of all of the items that can be done with Docker, but a general reference of the common tasks that will be executed on a regular basis.

If changes have been made to either the infrastructure or the bootstrapped data, it is suggested that you build a new image. You can also delete unneeded images - mostly you do this to free up hard drive space. Lastly, you can publish image changes to share with the general community.

Building the Image

The image should be built with the same name as the previous one, however you can create new ones that suite your need. An example of creating a new docker image is as follows:

docker build -t <DockerHub Username>/<Image Name> <Location of the Dockerfile>

For example, the standard way that is used to build the current image is the following:

docker build -t jlgrock/snp-prototype-mongodb .

Deleting an Image

To delete an image, you should use the command:

docker rmi <DockerHub Username>/<Image Name>

For example, if you wanted to delete the current image of the snp-prototype-mongodb, it would be the following:

docker rmi jlgrock/snp-prototype-mongodb

Publishing the Image

To push an image, you must follow the format:

docker push <DockerHub Username>/<Image Name>

Please note, that you must have this user and password created at Docker Hub.

The example that is used to push the current image is the following:

docker push jlgrock/snp-prototype-mongodb

Clone this wiki locally