Setting up drupal with docker using two containers? nginx and mariadb

I am trying to get a Drupal local development environment up and running using docker.

The site I am working on is live, running on a digital ocean server. When I access that server (ssh -p 1111 @
and run (docker ps) I can see two containers running. One is for the nginx-php5-drupal container that I got from here (

  • How to push to AWS EC2 Service Container from a specific git branch (ie 'staging')
  • How to map volume paths using Docker's --volumes-from?
  • Setting PYTHONPATH in Ubuntu 16.04 for a Docker image to run properly
  • Bitbucket API version 1
  • Deploying Docker Data Volumes
  • Docker and jenkins
  • The other container is a mariadb container that holds the database for the drupal site.

    I have run (docker export) on both of these containers, downloaded them and then set them up as images locally, named (mariadb:local) and (bnchdrff/nginx-php5-drupal:latest) respectively

    I then run:

    sudo docker run -d –name mariadb mariadb:local /sbin/init

    sudo docker run -d -p 80:80 -p 2222:22 –name nginx-php5-drupal-bnchdrff –link mariadb:db bnchdrff/nginx-php5-drupal:latest /sbin/init

    I then attempt to navigate to localhost:80 and/or localhost in my browser…

    Nothing appears.

    Am I doing this right?

    My understanding is patchy as I am new to all of this. I think the best thing for me to do is to restart the whole process from exporting the running containers from the live site to running them locally because I swapped out the live nginx-php5-drupal container for the old one from the github repo and I think the person who put the site online customised it…


  • How to use redirects in Docker
  • Not able to use a Dockerfile when using Jenkins CloudBees Docker Custom Build Environment Plugin
  • Launching jobs with large docker images in mesos via aurora can be slow
  • How to save all docker images and copy to another machine?
  • Docker Timezone in Ubuntu 16.04 Image
  • Where is my data located when I backup a docker container volume?
  • One Solution collect form web for “Setting up drupal with docker using two containers? nginx and mariadb”

    If you are on a MAC OS you’ll need to use the boot2docker ip address.
    You can get this by running the following command: boot2docker ip

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.