-
Notifications
You must be signed in to change notification settings - Fork 5
Managing Docker images
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.
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 .
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
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