We can create multiple instances of the same image. Containers are instances created from this class. We can liken a Docker image to a class definition. To browse the available images, we can visit Docker Hub and run docker pull to download them to the host machine. Ubuntu latest d2a0ecffe6fa 7 months ago 188.4 MBĮboraas/laravel latest 407e2d00b528 12 months ago 404.5 MB Mysql latest a128139aadf2 6 months ago 283.8 MB Nimmis/apache-php7 latest bdd370e4f83b 6 months ago 484.4 MBĮboraas/apache-php latest 0501b3fdd0c2 6 months ago 367 MB REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE We can list the available images on our machine by running the docker images command. We can share our final image on Docker Hub to make it accessible to everyone. We can also build distributable images that contain pre-configured software like an Apache server, a caching server, MySQL database, etc.
For example, installing it on Ubuntu or Debian is as easy as: $ apt-get update & apt-get install docker Docker Imagesĭocker is based on the concept of building images that contain the necessary software and configuration for applications. If you are a Linux user, Docker packages are popular and usually included in your distribution’s repository. If you’re using up-to-date versions of Windows or Mac, install Docker Desktop and you’re done. You can install it from a binary executable, or by using the official installer. Prerequisitesĭocker can be installed on most platforms. Once you start feeling this pain, you’ll start using a virtual environment to share and reproduce with ease.ĭocker provides us with containers that have all the virtualization capabilities we need, while also being more lightweight than the traditional virtual machines. Most developers use the (W|L|M)AMP stack as a starting point, but this environment can become overwhelming very quickly. Use the Fork button to copy the repository in your account:.To practice, we will start from a demo application which interacts with the Unsplash API to search for photos. Deploy our application with Continous Deployment (CD).Test our application with Continuous Integration (CI).Use Docker Compose to set up a dev environment.
You’ll learn the ins and outs of combining Docker with PHP and how to use Continuous Integration and Delivery to test your application, build a container and deploy it. Containers are the first step towards running your application with high availability with Docker Swarm or Kubernetes.Īfter reading the tutorial you’ll know what Docker is and how it works.Containers bring developers a uniform and streamlined work environment that can be easily shared.