So, you have successfully installed Docker. Brilliant! Now, what?! Well, the obvious thing to do is to go about running some containers. The Docker documentation suggests that you should pull and run the Hello World container, and although it is small, there are much better things we can do straight away to start to show the power of Docker.

Docker Pull & Docker Hub

To get started with running containers, you are first going to need to get some containers. As we have previously looked at containers contain all you need for a certain job or purpose, so with that in mind, let’s pull a really useful container. There are hundreds and thousands of containers available from Docker Hub, lets pull some of the most fun.

Unless you haven’t read anything else on this blog, you will probably know that I love Drupal. So why not pull the docker Drupal container:

$ docker pull drupal

Now you can go about installing Drupal, all from inside a Docker container

$ docker run --name i-love-drupal -l 8080:80 -d drupal

Excellent. Wait a little bit and then enter http://localhost:8080 and you will be able to see your fresh install of Drupal. Simple, painless. No more setting up of PHP, Apache, MySql… Just a docker container with everything you need. Obviously, it isn’t for use in production, but as a demo it is great. If we break down the command a little bit we can easily understand what is going on.

  • docker run = run docker
  • –name i-love-drupal = the command to name this container
  • -l 8080:80 = map local port 8080 to container port 80 (http webserver)
  • -d drupal = database name

Some Great Container Applications

  • Jenkins - docker pull jenkins
  • Wordpress - docker pull wordpress
  • Swagger Editor - docker pull swaggerapi/swagger-editor

What are you waiting for? Get out and have a go!