Intro to Docker for CMS



Similar documents
Intro to Docker and Containers

Platform as a Service and Container Clouds

Linux & Docker auf Azure

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

Linstantiation of applications. Docker accelerate

Docker : devops, shared registries, HPC and emerging use cases. François Moreews & Olivier Sallou

Command Line Crash Course For Unix

Implementing!SoftNAS!Cloud!with!Docker! November!2014!

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

Cassandra Installation over Ubuntu 1. Installing VMware player:

Contents Set up Cassandra Cluster using Datastax Community Edition on Amazon EC2 Installing OpsCenter on Amazon AMI References Contact

How Bigtop Leveraged Docker for Build Automation and One-Click Hadoop Provisioning

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

Building a Continuous Integration Pipeline with Docker

Moving Drupal to the Cloud: A step-by-step guide and reference document for hosting a Drupal web site on Amazon Web Services

ULTEO OPEN VIRTUAL DESKTOP V4.0

Installing an open source version of MateCat

Dry Dock Documentation

A Git Development Environment

UTILIZING THE PORTABILITY OF DOCKER TO DESIGN A PORTABLE AND SCALABLE CONTINUOUS INTEGRATION STACK

Docker Containers. Marko Ambrož, Žiga Hudolin Ministrstvo za javno upravo DIREKTORAT ZA INFORMATIKO

Installation Guide for AmiRNA and WMD3 Release 3.1

Partek Flow Installation Guide

Building Website with Drupal 7

Working with Docker on Microsoft Azure

The Subversion move/migrate from one server to another, shall be divided into 3 steps: Backup Create Import

SNPsyn documentation. Release 1.1b. Tomaž Curk Gregor Rot Davor Sluga Uroš Lotrič Blaž Zupan

GroundWork Monitor Open Source Installation Guide

Apache and Virtual Hosts Exercises

Ciphermail Gateway Separate Front-end and Back-end Configuration Guide

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

Amazon EC2 Container Service. Developer Guide API Version

GestióIP IPAM v3.0 IP address management software Installation Guide v0.1

Raspberry Pi Webserver

Linux System Administration on Red Hat

Tableau Spark SQL Setup Instructions

Server Installation/Upgrade Guide

Cloud Homework instructions for AWS default instance (Red Hat based)

DocuShare Installation Guide

ABS Manual Installation Guide

Continuous Integration and Automatic Testing for the FLUKA release using Jenkins (and Docker)

DocuShare Installation Guide

CPE111 COMPUTER EXPLORATION

IBM Pure Application Create Custom Virtual Image Guide - Part 1 Virtual Image by extending

OpenGeo Suite for Linux Release 3.0

Basic Linux & Package Management. Original slides from GTFO Security

研 發 專 案 原 始 程 式 碼 安 裝 及 操 作 手 冊. Version 0.1

CDH 5 Quick Start Guide

Welcome and thank you for considering enstratus as your cloud management platform.

Procedure to Create and Duplicate Master LiveUSB Stick

OS Installation: CentOS 5.8

Basic Installation of the Cisco Collection Manager

Putting It All Together. Vagrant Drush Version Control

User Manual of the Pre-built Ubuntu 9 Virutal Machine

Bring your intranet to the IBM i With Drupal and Zend Server

Recommended File System Ownership and Privileges

Using Docker in Cloud Networks

FILECLOUD HIGH AVAILABILITY

Single Node Hadoop Cluster Setup

Rancid Server Build and Operation Overview (v0.3) (This is being done from memory so expect some errors)

HOWTO. Configure Nginx for SSL with DoD CAC Authentication on CentOS 6.3. Joshua Penton Geocent, LLC

itixi Ubuntu Server Deployment How-To/Information

AWS Schema Conversion Tool. User Guide Version 1.0

Type-C Ubuntu Product & Strategy Canonical Ltd.

Tonido Cloud Admin Guide

Installing buzztouch Self Hosted

OPENPROJECT INSTALL ON CENTOS 7 RUNNING IN VMWARE PLAYER

Lecture 2 (08/31, 09/02, 09/09): Hadoop. Decisions, Operations & Information Technologies Robert H. Smith School of Business Fall, 2015

Installing Virtual Coordinator (VC) in Linux Systems that use RPM (Red Hat, Fedora, CentOS) Document # 15807A1-103 Date: Aug 06, 2012

Upgrading From PDI 4.0 to 4.1.0

Install and configure Apache, MySQL, PHP on OSX 10.8 Mountain Lion

Nagios. Contents. From SME Server. Maintainer

Magento Search Extension TECHNICAL DOCUMENTATION

IT6204 Systems & Network Administration. (Optional)

Railo Installation on CentOS Linux 6 Best Practices

How to Upgrade Oracle Software and Databases from Oracle Version x to for Ex Libris Applications

CN=Monitor Installation and Configuration v2.0

Chris Rosen, Technical Product Manager for IBM Containers, Lin Sun, Senior Software Engineer for IBM Containers,

CipherMail Gateway Upgrade Guide

Windows Template Creation Guide. How to build your own Windows VM templates for deployment in Cloudturk.

CO Web Server Administration and Security. By: Szymon Machajewski

Bulk Downloader. Call Recording: Bulk Downloader

Backup of ESXi Virtual Machines using Affa

An Information System

Installation and Control in Linux

Virtual machine W4M- Galaxy: Installation guide

How to install RADIUSdesk on CentOS 6.4 using Nginx

A curated Domain centric shared Docker registry linked to the Galaxy toolshed

Installation & Upgrade Guide

Zenoss Core ZenUp Installation and Administration

Installing and Running MOVES on Linux

Birmingham Environment for Academic Research. Introduction to Linux Quick Reference Guide. Research Computing Team V1.0

Installing Hadoop. Hortonworks Hadoop. April 29, Mogulla, Deepak Reddy VERSION 1.0

Fred Hantelmann LINUX. Start-up Guide. A self-contained introduction. With 57 Figures. Springer

Release Notes for McAfee(R) VirusScan(R) Enterprise for Linux Version Copyright (C) 2014 McAfee, Inc. All Rights Reserved.

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

nitrobit update server

Transcription:

Intro to Docker for CMS

About me I am Michael Klatsky System Admin and Architect Worked for Javanet, RCN, CT Telephone, TNR Global and Esperdyne Technologies Avid husband, father, homebrewer and dog lover

About Esperdyne Technologies, LLC Esperdyne Technologies (www.esperdyne.com) builds performant and scalable full-stack content analysis, parametric and full-text search solutions for publicly facing companies. Our professional services staf works closely with clients to properly identify project scope and mission critical milestones to ensure project success. Leverage OUR industry veterans as YOUR secret weapon!

What is Docker? Docker is a lightweight container system Docker eliminates the overhead associated with virtualization (think VMWare, VirtualBox) Docker allows for portability of containers Docker is a developer's dream rapidly test dependencies and versions

How do we use it? Company systems such as Redmine, LDAP, run in containers Deploy a highly specialized service in a container on an existing EC2 host Rapid testing of apps with various dependencies Easily scale apps from singles instances to multiple instance with one command

Today's Agenda Today, we will: learn how to install Docker learn how to run a container learn basic tasks learn how to deploy Drupal using Docker learn how to upgrade Drupal learn how to migrate a container from one host to another

Install Docker on OSX Docker requires a linux kernel To use Docker on OSX, obtain the installable package from here: https://github.com/boot2docker/osx-installer/releases/download/v1.2.0/boot2d ocker-1.2.0.pkg Follow the instructions here: http://docs.docker.com/installation/mac/ This installs 'boot2docker'

Install Docker on CentOS 7 Enable the CentOS-Extras repository yum install docker (yum install docker-io if using CentOS 6) service docker start chkconfig docker on

Install Docker on Windows Get the binary from: https://github.com/boot2docker/windows-installer/releases/downlo ad/v1.2.0/docker-install.exe Follow the instructions at: http://docs.docker.com/installation/windows/

Let's run a container When running a container, Docker will search locally for an image, and will download one from the Docker registry if not found docker run centos docker run ubuntu

Let's run a container and enter it to look around docker run --rm -t -i centos /bin/bash docker run --rm -t -i ubuntu /bin/bash The above commands will run a container and place you into a bash shell in the container. When you exit, the container will exit and go away.

How to deploy a Drupal container First, let's grab our images: docker pull esperdyne/mysql docker pull esperdyne/drupal:7.28 docker pull esperdune/drupal:7.31 Now, lets run the mysql container: docker run -d -p 3306:3306 --name DB -e MYSQL_ROOT_PASSWORD=mysecretpassword -e MYSQL_DATABASE=drupal -e MYSQL_USER=drupal esperdyne/mysql continued...

How to deploy a Drupal container Now, let's run our Drupal container and link it to our running mysql container: docker run -d --name drupal --link DB:DB -p 8888:80 esperdyne/drupal:7.28 Browse to http://hostaddress:8888/install.php and run through the install process as usual (insert your hostname/ip address in the URL)

Let's upgrade Drupal! docker rm -f drupal docker run -d --name drupal --link DB:DB -p 8888:80 esperdyne/drupal:7.31 Browse again to http://hostname:8888/install.php - check the status of your installation to see the new version!

What about data? But Houston, we have a problem! Data dies with the container if we delete the container, we lose the data For example, when we rebuild an image to add features, or to upgrade? A simple solution- bind mounts...

Save our data docker run -d -v /opt/mysql:/var/lib/mysql -p 3306:3306 --name DB -e MYSQL_ROOT_PASSWORD=mysecretpassword -e MYSQL_DATABASE=drupal -e MYSQL_USER=drupal esperdyne/mysql docker run -d --name drupal --link DB:DB -p 8888:80 esperdyne/drupal:7.31 The above will persist the mysql data on the host, rather than in the container.

Common tasks docker version docker inspect container docker stop container docker rm container docker ps docker ps -a docker images docker rmi image More info: https://docs.docker.com/reference/commandline/cli/

Build containers Container built using Dockerfiles Contain instructions for building images Can be simple, or complex

Dockerfile FROM centurylink/apache-php:latest MAINTAINER CenturyLink # Install packages RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade && \ DEBIAN_FRONTEND=noninteractive apt-get -y install supervisor pwgen && \ apt-get -y install mysql-client postgresql-client # Download v7.31 of Drupal into /app RUN rm -fr /app && mkdir /app && cd /app && \ curl -O http://ftp.drupal.org/files/projects/drupal-7.31.tar.gz && \ tar -xzvf drupal-7.31.tar.gz && rm drupal-7.31.tar.gz && \ mv drupal-7.31/* drupal-7.31/.htaccess./ && mv drupal-7.31/.gitignore./ && \ rmdir drupal-7.31 #Config and set permissions for setting.php ADD settings.php app/sites/default/settings.php RUN mkdir app/sites/default/files && \ chmod 600 app/sites/default/settings.php && \ chown www-data app/sites/default/settings.php && \ chmod 755 app/sites/default && chmod 777 app/sites/default/files EXPOSE 80 CMD exec supervisord -n

Dockerfiles, deux While docker files can be busy, they offer a repeatable way to build an image. The previous Dockerfile will build a drupal image. Simply issue the following command in the directory containing the Dockerfile: docker build -t mydrupal

FROM ubuntu:12.04 RUN apt-get update RUN apt-get install -y apache2 Dockerfile(simpler) ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 EXPOSE 80 ENTRYPOINT ["/usr/sbin/apache2"] CMD ["-D", "FOREGROUND"] This builds a container which just runs a webserver.

Upgrade the build Feel like building an upgraded image? RUN rm -fr /app && mkdir /app && cd /app && \ curl -O http://ftp.drupal.org/files/projects/drupal-7.28.tar.gz && \ tar -xzvf drupal-7.28.tar.gz && rm drupal-7.28.tar.gz && \ mv drupal-7.28/* drupal-7.28/.htaccess./ && mv drupal-7.28/.gitignore./ && \ rmdir drupal-7.28 In the above lines from our Dockerfile, simply change the version (7.28 -> 7.31), then run: docker build -t mydrupal Restart your container and voila!

Copy to a new host How do we copy a container to a new host? docker export db_new > db_new.tar Copy the tarfile to a new host (scp, ftp, etc) cat db_new.tar docker import db_new /usr/local/bin/run Now, just run the db_new image: docker run name my_db_new -d db_new

Fig: http://www.fig.sh Kitematic (OSX) https://kitematic.com Additional tools

Credits and more reading Century Link: http://www.centurylinklabs.com/category/docker-posts/ Kartar (The Docker Book): http://kartar.net Docker: http://www.docker.io Thomas Uhrig: http://tuhrig.de/tag/docker/ Digital Ocean: https://www.digitalocean.com/community/tags/docker?primary_filter=tutorials

Contact info For more information: Michael Klatsky Esperdyne Technologies, LLC Phone: 413-200-TECH (8324) http://www.esperdyne.com mklatsky@esperdyne.com