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 allow HTTP requests to other docker containers with RSpec?
  • MongoDB Authentication failed with mule api connector
  • couchbase-server in docker using go-couchbase timeout error
  • Accessing Docker-compose containers hostnames from a container
  • running tcpreplay with docker and boot2docker
  • Get the size of a Docker image before a pull?
  • 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…


  • Docker: multi kafka brokers failed
  • Issues in using git forked package in Docker-compose
  • Creating a Docker Compose for Rail App with Cassandra
  • How to set up executor IPs inside Docker containers?
  • Docker containers linking
  • Why does echo $VARIABLE, within a /bin/bash -c “…” section of a dockerfile run instruction, return empty on docker build?
  • 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.