Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker + Wodby + Docksal technology and comparison

Docker + Wodby + Docksal technology and comparison

This is my introductory talk on Docker that I gave on 1st Drupal Serbia meetup in Niš-

https://www.meetup.com/top-lista-drupalista/events/238489719/

The story about the docker is just too complex to be covered up with a single 40 minute talk, so I gave an overview on virtualization technologies and how is the docker positioned there.

Included in presentation, I showed practically how easy it is to start a container once the docker application is installed.

It enables both Windows and Mac to have seamless development integration of PHP, web server and database but also Linux would benefit from isolation of environments for different projects.

Get the docker here: https://www.docker.com/

Once installed, check Drupal quick start with this docker-compose.yml https://github.com/wodby/docker4drupal

More complex but powerful Drupal containers with Docksal (still experimental with native docker) with this docker-compose.yml https://github.com/docksal/docksal/

Both are multicontainer and require some understanding and familiarity with terminal. But both are powerful tools for every developer.

If you wish to discuss matters with me, you may wait for another live presentation or catch me somewhere online, I'm easy to find and always in a good mood for a discussion on any matter.

Mladen Đurić

April 08, 2017
Tweet

More Decks by Mladen Đurić

Other Decks in Programming

Transcript

  1. TIME-SPACE CONTINUUM & THE EXISTENCE OF GOD AND VERY BRIEFLY

    DOCKER 4 DRUPAL IN DEVELOPMENT Mladen Đurić @macmladen 1 TopListaDrupalista Niš 2017
  2. MLADEN ĐURIĆ a.k.a MacMladen • in IT since the time

    of mainframes, 8th year in UNIX epoch (that’s 1978). • started with Z80 assembly, went over 6502 to 8086 (1978-1990) • somewhere in between, there was an episode with BASIC but really enjoyed hard core C • was knee deep in DTP 1990-2000 • gone to Mac in 1995 and never looked back • 2005 started playing with web technologies • 2007 landed on Drupal :D 4 TopListaDrupalista Niš 2017
  3. TIMETABLE: 1. The Problem ~5 min 2. The Virtualization ~5

    min 3. The Docker ~10 min 4. The Solution ~10 min 5. Q & A: 10 min or more 5 TopListaDrupalista Niš 2017
  4. …JUST ONE?! 1. System setup - for development 2. Project

    setup - matching production 3. Quick fix of the old one - matching what was 4. Project setup - for a colleague 5. Project weirdos - matching production 6. Project requirements - one is 5.3 other 5.6, and 7.1… 7. System upgrade - what the !#$%&%$ happened to ___ 8. Testing - would that work under… 9. Archiving - I know what I did last summer but before that..!? 9 TopListaDrupalista Niš 2017
  5. TYPES OF VIRTUALIZATION 11 TopListaDrupalista Niš 2017 Full virtualization almost

    as a physical machine Hypervisor runs different OSes Isolation runs OSes on same kernel
  6. INSTALLATION 18 TopListaDrupalista Niš 2017 Docker Engine is supported on

    Cloud, Linux, Windows and Mac OS. wget -qO- https://get.docker.com/ | sh docker –version Docker is treated like other services. sudo service docker status
 sudo service docker start Test the installation using this code sudo docker run ubuntu:14.04 /bin/echo 'Hello world'
  7. docker command 20 TopListaDrupalista Niš 2017 sudo docker run -d

    -p 8080:80 --name apache --link mysql:mysql -v /var/www/html:/var/www/html jessecascio/ local:apache # verify the two containers are running, and link exists sudo docker ps sudo docker inspect -f "{{ .HostConfig.Links }}" apache
  8. Dockerfile 21 TopListaDrupalista Niš 2017 The Apache Dockerfile build configuration

    file can look like this: FROM ubuntu:14.04 RUN apt-get update RUN apt-get install -y apache2 RUN apt-get install -y php5 php5-common php5-cli php5-mysql php5-curl EXPOSE 80 CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
  9. docker-compose command 22 TopListaDrupalista Niš 2017 version: "2"
 
 services:


    mariadb:
 image: wodby/drupal-mariadb
 restart: unless-stopped
 environment:
 MYSQL_ROOT_PASSWORD: drupal
 MYSQL_DATABASE: drupal
 MYSQL_USER: drupal
 MYSQL_PASSWORD: drupal
 volumes:
 - ./docker-runtime/mariadb:/var/lib/mysql
 - ./databases:/var/lib/mysql/databases
 
 php:
 image: wodby/drupal-php:7.0 # Allowed: 7.0, 5.6.
 restart: unless-stopped
 environment:
 PHP_SITE_NAME: dev
 PHP_HOST_NAME: mensainabox.dev.dx.rs
 PHP_DOCROOT: docroot # Relative path inside the /var/www/ html/ directory.
 PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
 volumes:
 - ./:/var/www/html
 - ./docker-runtime/drush:/home/www-data/.drush
 
 nginx:
 image: wodby/drupal-nginx
 restart: unless-stopped
 environment:
 NGINX_SERVER_NAME: localhost
 NGINX_UPSTREAM_NAME: php
 NGINX_DOCROOT: docroot # Relative path inside the /var/www/ html/ directory.
 DRUPAL_VERSION: 8 # Allowed: 7, 8.
 VIRTUAL_HOST: project.web.loc volumes:
 - ./:/var/www/html
 
 pma:
 image: phpmyadmin/phpmyadmin
 restart: unless-stopped
 environment:
 PMA_HOST: mariadb
 PMA_USER: drupal
 PMA_PASSWORD: drupal
 PHP_UPLOAD_MAX_FILESIZE: 1G
 PHP_MAX_INPUT_VARS: 1G
 VIRTUAL_HOST: project.web.loc
 volumes:
 - ./docker-runtime/metro:/www/themes/metro
 
 mailhog:
 image: mailhog/mailhog
 restart: unless-stopped
 environment:
 VIRTUAL_HOST: project.web.loc
 VIRTUAL_PORT: 8025
 The Drupal docker-compose.yml may looks like this:
  10. 23 TopListaDrupalista Niš 2017 docker and docker-compose commands docker controls

    individual containers by name or ID while docker-compose controls a group of containers, usually called application or stack. Usual Docker commands: docker ps -a — lists all docker containers, running, paused and stopped. docker inspect mcidev_nginx_1 — lists all details about the container by name or ID docker stats --no-stream — shows resource usage, omit --no-stream to have live stats docker-compose up -d — while in directory structure containing docker-compose.yml, creates and starts application. docker-compose pull — fetch latest version of containers. docker-compose stop — stops application docker-compose start — starts application docker-compose restart — restarts application docker-compose down — remove containers (instance of contaners images)