scalatra + docker (part 5)
Here’s a github repo which will track this project
–
In our last post we successfully built a Docker image and started a container based on that image. Now, we are going to publish the image to Docker Hub so that we can use it in other projects.
First step is to sign up for a Docker Hub account.
Once you have an account established, we need to tag our Scalatra app image appropriately.
Now check docker images
again to confirm the tag has been applied.
Now just run docker login
and enter your credentials.
Finally, issue the command to push the image (using your account name of course):
Now if you check your account on Docker Hub, you will see a page for the image.
To confirm, run docker rmi
with the image number to delete it locally. Then execute the docker run
command from the last tutorial with the remote image tag. Your image will be pulled and started!