Docker: Drupal with MySQL example of linking containers

by TheodorosPloumis secret
GNU/Linux ◆ xterm-256color ◆ zsh 198 views

cd ~/Docker-presentation mkdir drupal-link-example cd drupal-link-example

docker pull drupal:8.2.3-apache docker pull mysql:8

// Start a container for mysql docker run –name mysql_example \

           -e MYSQL_ROOT_PASSWORD=root \
           -e MYSQL_DATABASE=drupal \
           -e MYSQL_USER=drupal \
           -e MYSQL_PASSWORD=drupal \
          -d mysql:8

// Start a Drupal container and link it with mysql // Usage: –link [name or id]:alias docker run -d –name drupal_example \

           -p 8280:80 \
           --link mysql_example:mysql \
           drupal:8.2.3-apache

// Open http://localhost:8280 to continue with the installation // On the UI for the db host use: mysql

// There is a proper linking docker inspect -f “{{ .HostConfig.Links }}” drupal_example