Day 11: Using Docker to build and deploy a distributed app

#100DaysOfCode

Docker allows users to package an application with all of its dependencies into a standardized unit for easily deploying on cloud for use in a distributed manner. It allows developers to build, ship and run applications on any platform with ultra high efficiency across thousands of machines. This has been highly adopted by the dev community to collaborate around libraries of containers.

As shown in the Google search trends graph below, Docker’s rise has been exponential with several billion containers being run every week.

Image for post
Image for post
Google Search Trend for ‘Docker’

We all have been through the painful process of setting up local dev environments and sharing application configurations at some point or another. Now Docker does sound awesome to get over all that headache, so I thought will give it a spin. Lets get started.

Project: Setup Docker and create a simple webapp container which will be hosted in a public container repo in https://hub.docker.com/. Build and deploy the webapp to Docker and pull it from the cloud running it on a Ngnix Webserver locally.

All the code for this project can be found on my github

Docker container used in this project can be found on my registry

Step 1: Install Docker

Follow the instruction for installing Docker as per your OS: Mac, Linux and Windows.

Step 2: Run Docker

Image for post
Image for post
docker run hello-world
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Step 3: Creating and using Docker containers for Webapp

Now that we have gotten familiar with basic Docker command, lets get started and build a Docker image of our own and use it to run a webapp on Ngnix Webserver.

For the purpose of this project the image that we are going to use is a single static page that I have created and posted to my github page. I have hosted this as a public repo container in Docker registry — harini/static-site.

docker run harini/static-site
Image for post
Image for post
Image for post
Image for post

More on creating your own docker container image next time!

Day 11 of #100DaysOfCode DONE

If you enjoyed this, please click 👏 so that others can enjoy it as well. Follow me on Twitter @HariniLabs to get the latest updates or just to say Hi :)

PS: I curate a bi-weekly #WomenInTech newsletter for a dose of inspiration from the world of tech and yes men can signup too! Get it here :)

Global Head of Technology @Antler. Prev: VP - Engineering @BlackRock. Started #100DaysOfCode #WomenInTech

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store