Docker

What is Docker?

Docker is an open platform for developing, shipping, and running container-based applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.  Originally built for Linux, Docker now runs on Windows and MacOS as well.  With Docker, you can manage your infrastructure in the same ways you manage your applications. 


"451 Research predicts that "the application container market will explode over the next five years. Annual revenue is expected to increase by 4x, growing from $749 million in 2016 to more than $3.4 billion by 2021, representing a compound annual growth rate (CAGR) of 35 percent." (Source)



Docker can get more applications running on the same hardware than other technologies; it makes it easy for developers to quickly create ready-to-run containered applications and it makes managing and deploying applications much easier. 


"Docker is a platform which packages an application and all its dependencies collectively in the form of containers. And, Docker’s aspect of containerization ensures that the application can work in any environment." (Source)


Sample Docker deployment (click here)

Create some sample 'php' code in the 'src' folder. For example...

<?php

  echo "Rodney Dangerfield -- ";

  echo "'I told my psychiatrist that everyone hates me. He said I was being ridiculous - everyone hasn't met me yet.'";

?>


Create your Dockerfile. For example...

FROM php:7.2-apache

COPY src/ /var/www/html/

EXPOSE 80


Build and run commands...

$ docker build -t rodney .

$ docker run -p 80:80 rodney

$ docker run -d --name my-running-app rodney


Test it...

http://localhost 



Learn Docker in 12 Minutes

Benefits...



Docker Hub is a hosted repository service provided by Docker for finding and sharing container images with your team. Key features include: Private Repositories: Push and pull container images. Automated Builds: Automatically build container images from GitHub and Bitbucket and push them to Docker Hub. Docker Hub repositories allow you share container images with your team, customers, or the Docker community at large. A single Docker Hub repository can hold many Docker images (stored as tags).


"Docker enables developers to easily pack, ship, and run any application as a lightweight, portable, self-sufficient container, which can run virtually anywhere. Containers gives you instant application portability." (Source)