The smart drop and the clever whale — there is no doubt that Drupal and Docker are highly compatible! It seems like their element is water, however, their true “element” is efficiency. Flexibility, security, and open-source standards are also worth mentioning. So after sharing a collection of useful links for working with Docker, we would like to take a closer look at this great “couple” and see why it’s worth using Docker to boost your Drupal development.
Docker: where containerization starts
The best shipping service should be able pack your things well, so they do not take up much space and are properly separated from each other. It should then take them quickly and securely to any place, and you should know they will arrive in the same condition you sent them in.
Docker offers more than that. This lightweight, secure, open-source containerization platform is meant for creating, shipping and running your app or website. You can easily pack it – together with all its dependencies, settings and everything else it needs for working – into a Docker image, and then run it anywhere regardless of the environment. When you start your image, you get a container running. Containers, or instances of images, can be multiple for one image.
Docker in Drupal development: use areas and benefits
Docker makes the lives of Drupal developers and system administrators much easier by simplifying and streamlining many processes which include, but are not limited to:
- setting up a new environment
- deploying your new Drupal website’s copy
- continuous integration
- migrating your website to another server
- website upgrades from one Drupal version to another
- building, scaling, testing, and debugging your Drupal website
- configuring an infrastructure
Why exactly is Docker so helpful to Drupal developers and admins in all that and more? Let’s see.
- Consistency is all you need. Docker lets you improve collaboration between developers who work in different environments. It is easy to switch from a project using one PHP version to a project using a different version. Docker also provides good isolation from the host OS.
- Containers are highly configurable, fast and easy to create, configure, scale vertically and horizontally, discard or rebuild.
- Containers do not take up much space on disk — they are very lightweight. There can be many of them on the same host machine.
- The isolation of containers from each other lets the whole system stay uncompromised in case something goes wrong with one container. Usually, one container is responsible for one process or service. Container isolation is not complete (as is the case with classic virtual machines), but it is still beneficial for speed.
- There are plenty of helpful Docker images for Drupal on Docker hub that you can use right away. For example, our company’s repos offer lots of Docker images (1 and 2). You could also check out the popular Docker4Drupal stack by Wodby that will help you speed up your local development on Linux, Mac OS X and Windows. It offers ready-made images with Nginx, Apache, MariaDB, Drush, Solr, PHP and much more. And a fresh Docker4Drupal 2.3.0 version has been released a week ago with nice updates.
This is a just a drop in the ocean of what Docker can do for your Drupal development. We wish you luck in diving deeper and deeper into its endless capabilities, discover ready-made stacks, or be inspired to create your own. And our team is always ready to help you use Docker with maximum efficiency!