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 @234.234.234.23)
and run (docker ps) I can see two containers running. One is for the nginx-php5-drupal container that I got from here (https://github.com/bnchdrff/dockerfiles)

  • Connect to MySQL in a docker container (Vagrant on Windows/VirtualBox)
  • New version of postgresql docker container doesn't have the new added data
  • Unable to connect to server when running docker django container?
  • How to add postgresql library pgroonga when make docker compose?
  • How to ensure to update Docker image on AWS ECS?
  • How to setup nginx as reverse proxy for Ruby application (all running inside Docker)
  • 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…

    Thanks.

  • Docker: kill/stop/restart a container, parameters maintained?
  • Docker IPv6: Disable IPv4 in bridge docker0 and docker network
  • How to get the name of a Docker container using JavaScript?
  • add hosts redirection in docker
  • How to rebuild dockerfile quick by using cache?
  • Bash Script to execute Docker container operations and extract container IP Address
  • 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

    https://docs.docker.com/installation/mac/

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