Docker Hub Hello World
I sat down this weekend with the intention of putting my own Docker Hub image on Amazon Web Services (AWS). I planned to piggyback on what I had learned in my previous post Getting Docker Running On AWS.
I quickly realized I was trying to run before I knew how to walk. I dug around the Docker website and found a fantastic tutorial on how to create a hello world style Docker Hub repository - Docker Documentation for Mac.
You can find similar Docker installation for Windows and Linux.
Docker Installed
Reference the "Let's Get Started Locally!" section in Getting Docker Running On AWS.
Find and Run
The next section, Find and run the whalesay image, walks the user through how to search and run a particular Docker image. We implicitly touched on this in my previous Docker post.
This section is nice as it explicitly explains the steps necessary to search and find images. In addition, it helps the user to understand how to run an image, then run subsequent commands on the created container.
Creating a Dockerfile
Once we are comfortable finding and running an image, Build your own image takes us to the next level: How to create a Dockerfile.
Once again, the tutorial is pretty solid. It gives step-by-step instructions on how to create a Dockerfile based upon the previously loaded docker/whalesay image. I really like how the author walks through the necessary commands, then explains each step's purpose in detail.
Create a DockerHub Account
It's pretty self-explanatory, but here is the link: Create a Docker Hub account & repository.
Profit! (Tag and Push)
The next section is where a lot of the magic happens, Tag, push, and pull your image. The commands are relatively simple. The tutorial walks through tagging an image, logging in via the docker command, and then pushing up to Docker Hub.
https://hub.docker.com/r/dev3l/docker-whale/
docker run dev3l/docker-whale
Conclusion
We now have a Docker image that anyone can pull down and run.
What are our next steps? Looking at Docker Hub, I notice there is no Dockerfile in my repository. Why is that?
At the end of the Docker getting started tutorial, there is a section for Learning more. I Googled searched quickly, and in order to get your Dockerfile published and available, we need to create an automated build.
With that said, Automated Builds on Docker Hub (Coming soon)!
Get In Touch
We'd love to hear from you! Whether you have a question about our services, need a consultation, or just want to connect, our team is here to help. Reach out to us through the form, or contact us directly via social media.