Delete and Pull

Just like with Git and GitHub, the nice thing about having images in the cloud is that if something happens to your computer, or you are deploying to a remote server, you can always pull down your images without having to build them from source.

Let’s test our published image by deleting our local copy and pulling it from the cloud.

  1. Remove your local image: The docker image rm command deletes the image from your local machine’s storage.

    docker image rm USERNAME/goserver
  2. Pull it back down from Docker Hub:

    docker pull USERNAME/goserver
  3. Run it to ensure it still works:

    docker run -p 8991:8991 USERNAME/goserver