Iterating Faster with Docker + Cascade

Slides:



Advertisements
Similar presentations
WordPress Installation for Beginners Sheila Bergman
Advertisements

Implementing Tableau Server in an Enterprise Environment
Calendar Browser is a groupware used for booking all kinds of resources within an organization. Calendar Browser is installed on a file server and in a.
Server-Side vs. Client-Side Scripting Languages
Presented by Mina Haratiannezhadi 1.  publishing, editing and modifying content  maintenance  central interface  manage workflows 2.
The easy way to a nice looking website design By a total non-designer (Me!)
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
Model a Container Runtime environment on Your Mac with VMware AppCatalyst VMworld Fabio Rapposelli
Guidelines for Homework 6. Getting Started Homework 6 requires that you complete Homework 5. –All of HW5 must run on the GridFarm. –HW6 may run elsewhere.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
1 PUPPET AND DSC. INTRODUCTION AND USAGE IN CONTINUOUS DELIVERY PROCESS. VIKTAR VEDMICH PAVEL PESETSKIY AUGUST 1, 2015.
Breaking Barriers Exploding with Possibility Breaking Barriers Exploding with Possibility The Cloud Era Unveiled.
CNIT 124: Advanced Ethical Hacking Docker (not in textbook) & Ch 8: Exploitation.
IN THIS LESSON WE WILL REVIEW THE STRUCTURE OF THE INTERNET AND HOW BROWSERS ASSEMBLE WEBSITES BASED ON INSTRUCTIONS THEY RECEIVE FROM SERVERS. Internet.
XAMPP.
Here are some things you can do while you wait 1.Open your omeka.net site in your browser (e.g. 2.Open.
Alfresco deployment with Docker Andrea Agili Software Engineer – Dr Wolf srl Tommaso Visconti DevOps – Dr Wolf srl.
Drupal Basics May 30, 2012 By Sean Fitzpatrick. Sean Fitzpatrick | Welcome We're going to talk about Drupal We're going to keep it pretty.
XNAT 1.7: Getting Started 6 June, Introduction In this presentation we’ll discuss:  Features and functions in XNAT 1.7  Requirements  Installing.
Getting Started as an EdgeX Developer
Kickstart drupal development
Getting & Running EdgeX Docker Containers
Tonga Institute of Higher Education IT 141: Information Systems
Let's talk about Linux and Virtualization in 'vLAMP'
Agenda:- DevOps Tools Chef Jenkins Puppet Apache Ant Apache Maven Logstash Docker New Relic Gradle Git.
INTRO TO Presenter: PhuongNQK.
Containers as a Service with Docker to Extend an Open Platform
Fundamentals Sunny Sharma Microsoft
Apache Ignite Data Grid Research Corey Pentasuglia.
Segments Basic Uses: slides minutes
Containers: The new network endpoint
Docker Birthday #3.
Tomcat Celsina Bignoli
6/11/2018 8:14 AM THR2175 Building and deploying existing ASP.NET applications using VSTS and Docker on Windows Marcel de Vries CTO, Xpirit © Microsoft.
ITS 145: Intro to Information Systems
In-Depth Introduction to Docker
Getting Started as an EdgeX Developer
Containers and Virtualisation
IT Atoumation / Conf. Mgmt...
ASP.NET in Linux and Windows containers
Andrew Pruski SQL Server & Containers
PHP / MySQL Introduction
Drupal VM and Docker4Drupal For Drupal Development Platform
Module 3 Building a web app.
Drupal VM and Docker4Drupal as Consistent Drupal Development Platform
Introduction to Docker
Oracle DB and Docker Get Your Dockerized Oracle Sandbox Running in the Cloud or On- Premises Martin Knazovicky Dbvisit Software.
02 | Hosting Services in Windows Azure
Advisor: Dr.vahidipour Zahra salimian Dec 2017
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Intro to Docker Containers and Orchestration in the Cloud
Comparison of nopCommerce with its competitors
Tonga Institute of Higher Education IT 141: Information Systems
Microsoft Virtual Academy
Docker, Drupal and Persistence
Tonga Institute of Higher Education IT 141: Information Systems
Cordova & Cordova Plugin Installation and Management
IntroductionToPHP Static vs. Dynamic websites
Intro to PHP.
CloudOpting - Hackathon
Introduction to Docker
Azure Container Service
Review of Previous Lesson
Web Application Development Using PHP
The Future of Database Development (with containers)
SQL Server on Containers
Presentation transcript:

Iterating Faster with Docker + Cascade John David Garza Cascade User Conference • October 2017

Introduction Who am I? What do I do? Cascade Users since 2014 The University of Texas at San Antonio What do I do? Joined 2015 University Webmaster Communications and Marketing Cascade Users since 2014 University is very decentralized Lots of environments Lots of websites

Show & Tell Demo Local Development Docker + Cascade Docker + Lucee Smaller contexts Docker + Lucee Replicating existing sites/infrastructure Docker + Wordpress Over 25% of the web! Switch to safari and show currently running containers Lucee for coldfusion development Local alerts development Docker cascade Mailcatcher?

Today’s Agenda Introduction Show and Tell Demo (why docker) Prerequisites What is Docker and Why Use It Learn by Example Demo 1 – beginner (tomcat + docker) Demo 2 – intermediate (mysql + docker) Demo 3 – advanced (cascade + docker) Wrap-Up/More Resources

Prerequisites This talk will be technical heavy Familiar with Linux? Server Administration? Comfortable with the command line? Familiar with Java application servers (tomcat) Have you ever installed/configured cascade? Code for this presentation is available on bitbucket (git) https://bitbucket.org/utsaucm/docker-demos prerequisites this talk will be technical heavy familiar with server administration? VMs? (This will help with understanding the concepts) familiar with linux? ++ (1 shell script, several configuration files) comfortable with the command line? ++ (demos are in git and easily accessible with a text reader) familiar with standard relational databases? (oracle, mysql, mssql) familiar with configuring java application servers? (wildfly, tomcat) have you ever deployed cascade? +++ i'll be demoing with this mac, but steps should be easily reproducible on a windows pc and linux pc what is docker? [docker vs VM image] [https://www.docker.com/what-docker] "software container platform" "Docker automates the repetitive tasks of setting up and configuring development environments"

Docker: What is it? “lightweight VMs” https://www.docker.com/ what-docker “Docker automates the repetitive tasks of setting up and configuring development environments” Docker > Containers > Images what is docker? [docker vs VM image] [https://www.docker.com/what-docker] "software container platform" "Docker automates the repetitive tasks of setting up and configuring development environments” I like using the paraphrase: "lightweight VM" Docker has it roots in cgroups and LinuX Container (LXC) which started back in 2008 2013 Docker emerged as container management tool which used LXC to implement containers Containers are described by a Dockerfile, this file tells docker how to build a container, what files are needed, what packages may need to be installed, etc. Docker utilizes a Docker Registry [https://hub.docker.com] which makes it easy for anyone to share their container recipes (Dockerfiles) what problem does it solve? (why?) "works on my computer" screenshot of emailonacid i already deal with this for emails, why would i want to deal with it in my development environment? lighter than VMs screenshot of waiting for windows to load in VMware? VMs don't scale well: decentralized university === lots of different environments: IIS, Apache, Nginx HTML, ColdFusion, PHP, ASP, Java mysql, mssql, oracle consistent, reproducible deployments full stack portability

Docker: What is it? Beginning Concepts Container Dockerfile Registry Images Dockerfile Registry what problem does it solve? (why?) "works on my computer" screenshot of emailonacid i already deal with this for emails, why would i want to deal with it in my development environment? lighter than VMs screenshot of waiting for windows to load in VMware? VMs don't scale well: decentralized university === lots of different environments: IIS, Apache, Nginx HTML, ColdFusion, PHP, ASP, Java mysql, mssql, oracle consistent, reproducible deployments full stack portability

Learn By Examples / Demos

Describe steps to install app Leverage Docker Hub Demo 1 Docker + tomcat Dockerfile Start from a base image Describe steps to install app Leverage Docker Hub Registry where Dockerfiles are published hub.docker.com/_/tomcat/ Demo – 01 – Running tomcat in Docker Docker operates by using a Dockerfile This file tells docker how to build the container you want to run Think of it as a cookbook, recipe, that docker will follow if it was to build a new machine for you to run your application For any given application, this involves Starting FROM a base image, think of this as a fresh server with a brand new linux distro installed on it Then we use RUN to tell docker which commands to run to get our application installed Screenshot on the right is the official Open JDK java Dockerfile published on Docker Hub Utilizes Alpine Linux as the base image (super small distro ~30mb) We’ll use the official tomcat builds to effectively skip most of these installation steps and start with an image ready to run tomcat so we can get on with running our application

We can use an official repository to build tomcat Demo 1 Docker + tomcat We can use an official repository to build tomcat We’ll supply our own context.xml but more on that later Our Dockerfile will now be really short We start FROM the official tomcat dockerfile repository with the 8-alpine tag, this tell docker to start by first downloading the container that builds a container with open jdk and tomcat 8 We can use the COPY command to replace files in the container with files we have on our host machine, in this case, maybe we want to give tomcat our own version of context.xml (this is one of the files that is required to be customized with database connection info when running cascade, but more on that in a bit) We can build this container with this dockerfile directly using the docker build command, but then we’d just have a vanilla install of tomcat We would still have to package our own web app and then use the tomcat manager to deploy it to tomcat, let’s have docker do that for us!

Demo 1 Docker + tomcat File structure and resulting cli for docker to get us up and running We have a simple web app here, called “publish”, it’s a very small web application, with a single index.html file Important things to note: - this file and parent directory lives on our host machine (this laptop) - we will utilize a docker volume to share this local directory with our docker container - this will allow us to have access to this web app folder after we’ve “launched” our container

Docker build -t my-tomcat Demo 1 Docker + tomcat Docker build -t my-tomcat This will tell docker to create a new container and name it “my-tomcat” Then you can run this container by name Docker run … my-tomcat Will still need the –it, –p and –v arguments We will see a better way to do this in demo 3 Instead, we can use docker build to create a new container with our local dockerfile -t names the container so we can do: Docker run …. <container_name>

Demo 1 Docker + tomcat Demo slide of tomcat running locally with the copied publish

ENV – environment variables Strategy for defining configuration Demo 2 Docker + mysql ENV – environment variables Strategy for defining configuration Demo 2 - Persisting data Containers are meant to be stateless, transient, ephemeral -v in last demo When we want to container to persist data, we utilize data volumes hub.docker.com/r/mysql/mysql-server/ Official builds often use environment variables as a shorter way of configuring your container without having to use the COPY command to replace files - remember that changes to the file structure of your container will require an extra image being added to your container being built - environment variables offer a shortcut around this This is a strategy that is often used in local development with docker, but security should strongly be considered when using this in a test or production environment To get our

Demo 2 Docker + mysql File structure and resulting cli for docker to get us up and running We have a simple web app here, called “publish”, it’s a very small web application, with a single index.html file Important things to note: - this file and parent directory lives on our host machine (this laptop) - we will utilize a docker volume to share this local directory with our docker container - this will allow us to have access to this web app folder after we’ve “launched” our container

docker build –t my-mysql docker run –it –p 3302:3306 Demo 2 Docker + mysql docker build –t my-mysql docker run –it –p 3302:3306 -v $(pwd)/mysql-data:/var/lib/mysql my-tomcat Breakdown of our tomcat.sh bash script docker run: we are telling docker to run this container -it : actually two arguments, -I is for interactive, which means this container will utilize the CLI’s standard input/output (STDIN/STDOUT/STDERR), -t will tell docker to use a pseudo-tty for this container - this will allow us to stop the container much like we would stop any other process -p: 8080:8080: Here we are mapping the container’s port 8080 with our host’s (laptop) port 8080, resulting into tomcat being accessible from our browser at http://localhost:8080 Tomcat:8-alpine **this will only run the Dockerfile in the docker hub registry, nothing special here**

Demo 2 Docker + mysql Breakdown of our tomcat.sh bash script docker run: we are telling docker to run this container -it : actually two arguments, -I is for interactive, which means this container will utilize the CLI’s standard input/output (STDIN/STDOUT/STDERR), -t will tell docker to use a pseudo-tty for this container - this will allow us to stop the container much like we would stop any other process -p: 8080:8080: Here we are mapping the container’s port 8080 with our host’s (laptop) port 8080, resulting into tomcat being accessible from our browser at http://localhost:8080 -v: this is our volume mapping command we are telling docker to create a volume container with our current directory/webapps and mount it to the /usr/local/tomcat/webapps directory inside the container instead of seeing the regular default tomcat webapps folder that tomcat comes with in an vanilla install, tomcat will instead see our webapps folder with the publish webapp tomcat:8-alpine: here we are telling it which repository/container to build

Tying it all together Items you will need Demo 3 Docker + cascade Tying it all together Items you will need Local development license from Hannon Hill support@hannonhill.com Cascade SQL seed script https://help.hannonhill.com/hc/en-us/articles/222486028- Setting-up-the-database-MySQL- Cascade Downloaded https://www.hannonhill.com/downloads/cascade/ Breakdown of our tomcat.sh bash script docker run: we are telling docker to run this container -it : actually two arguments, -I is for interactive, which means this container will utilize the CLI’s standard input/output (STDIN/STDOUT/STDERR), -t will tell docker to use a pseudo-tty for this container - this will allow us to stop the container much like we would stop any other process -p: 8080:8080: Here we are mapping the container’s port 8080 with our host’s (laptop) port 8080, resulting into tomcat being accessible from our browser at http://localhost:8080 -v: this is our volume mapping command we are telling docker to create a volume container with our current directory/webapps and mount it to the /usr/local/tomcat/webapps directory inside the container instead of seeing the regular default tomcat webapps folder that tomcat comes with in an vanilla install, tomcat will instead see our webapps folder with the publish webapp tomcat:8-alpine: here we are telling it which repository/container to build

cascade.sql in mysql directory Demo 3 Docker + cascade context.xml Modified per cascade instructions help.hannonhill.com/hc/en-us/articles/222451947- Installation-using-the-ZIP-file- cascade.sql in mysql directory COPY ./cascade.sql /docker-entrypoint- initdb.d/db.sql ROOT added to tomcat/webapps directory This is ROOT.zip downloaded from hannonhill.com docker-compose.yml - ??? We are pretty much using the previous examples without change The context.xml I hinted at in our first demo is just the cascade configured context.xml file ROOT in tomcat/webapps is the cascade we downloaded from hannonhill.com, we don’t need to make any modifications to this directory And last but not least, docker-compose.yml

Updated tomcat Dockerfile New COPY addition Demo 3 Docker + cascade Updated tomcat Dockerfile New COPY addition Our Dockerfile will now be really short We start FROM the official tomcat dockerfile repository with the 8-alpine tag, this tell docker to start by first downloading the container that builds a container with open jdk and tomcat 8 We can use the COPY command to replace files in the container with files we have on our host machine, in this case, maybe we want to give tomcat our own version of context.xml (this is one of the files that is required to be customized with database connection info when running cascade, but more on that in a bit) We can build this container with this dockerfile directly using the docker build command, but then we’d just have a vanilla install of tomcat We would still have to package our own web app and then use the tomcat manager to deploy it to tomcat, let’s have docker do that for us!

Demo 3 Docker + cascade What is docker compose? Containers should follow the single responsibility rule Compose is a tool for defining and running multi-container Docker applications Allows us to also describe our runtime arguments (-v, -p, etc) https://docs.docker.com/compose/overview/ The last thing we want to do is make one big Dockerfile describing our mysql and tomcat application. Since containers are cheap, we can separate our concerns and define each application block in it’s own container Compose is a tool for defining and running multi-container Docker applications We can then use docker compose commands to bring up or down our entire application stack (or even parts of the stack) Things to note here: The service names have meaning, we can instruct docker compose to bring up a single service using these names docker-compose up tomcat Or just to build when we make changes: docker-compose build tomcat These names are just used by docker-compose, docker will generate a container specific name Links: this sets up service discovery, this is the real magic Using link: mysql:mysql in the tomcat service tells docker to make sure the tomcat container can talk with our mysql container using the name “mysql” This allows us to setup our database connection to cascade inside our context.xml using the host address: mysql

docker-compose build docker-compose up Demo 3 Docker + cascade Breakdown of our tomcat.sh bash script docker run: we are telling docker to run this container -it : actually two arguments, -I is for interactive, which means this container will utilize the CLI’s standard input/output (STDIN/STDOUT/STDERR), -t will tell docker to use a pseudo-tty for this container - this will allow us to stop the container much like we would stop any other process -p: 8080:8080: Here we are mapping the container’s port 8080 with our host’s (laptop) port 8080, resulting into tomcat being accessible from our browser at http://localhost:8080 Tomcat:8-alpine **this will only run the Dockerfile in the docker hub registry, nothing special here**

To run out last demo we need only to run: docker-compose up Demo 3 Docker + cascade To run out last demo we need only to run: docker-compose up

Wrap-Up / More Resources

Where do we go from here? Dockerize one or your environments! Docker Hub is your friend https://hub.docker.com Official Docker Newsletter https://www.docker.com/newsletter-subscription Docker Captains Network https://www.docker.com/community/docker-captains Dockercon on YouTube https://www.youtube.com/user/dockerrun Today’s demos https://bitbucket.org/utsaucm/docker-demos Best next steps is to try it yourself! - My initial steps was utilizing docker to replicate our wordpress setup, but I first just started with nginx and php for locallly testing some php files - Searching for a reading other people’s dockerfiles is the best way to use docker hub Docker puts out a weekly email newsletter, not just highlighting their latest developments, but often featuring HOWTO tutorials and blog posts from the community Also gives a good calendar on upcoming meetups Docker’s evangelists are called Docker Captains. They are usually very prolific on the web, sharing their own projects via blog posts and videos For the past couple of years, DockerCon, the yearly convention held by Docker livestream on youtube and are also a great place to learn

Questions? and Thanks!