29
DOCKERIZE WORDPRESS ON MAC/WINDOWS WordCamp Kansai 2016

Dockerize WordPress on Mac/Windows

Embed Size (px)

Citation preview

Page 1: Dockerize WordPress on Mac/Windows

DOCKERIZE WORDPRESS

ON MAC/WINDOWSWordCamp Kansai 2016

Page 2: Dockerize WordPress on Mac/Windows

WordPress core contributor

Ruby on Rails contributor

Wocker developer

Bathe developer

Frasco developer

Web & graphic designer

Programmer

KiteKITERETZ inc. CEO & Funder

! kite.koga " ixkaito # ixkaito

Page 3: Dockerize WordPress on Mac/Windows

HOW MANY PEOPLE

KNOW DOCKER?

Page 4: Dockerize WordPress on Mac/Windows

HOW MANY PEOPLE

HAVE USED DOCKER?

Page 5: Dockerize WordPress on Mac/Windows

WHAT IS DOCKER?

Page 6: Dockerize WordPress on Mac/Windows

PACKAGE YOUR APPLICATION INTO A

STANDARDIZED UNIT FOR SOFTWARE

DEVELOPMENTDocker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.

Page 7: Dockerize WordPress on Mac/Windows

- Lightweight- Open- Secure by default

ADVANTAGES OF DOCKER

Page 8: Dockerize WordPress on Mac/Windows

COMPARING

CONTAINERS AND

VIRTUAL MACHINES

Page 9: Dockerize WordPress on Mac/Windows

VIRTUAL MACHINESVirtual machines include the application, the necessary binaries and libraries, and an entire guest operating system -- all of which can amount to tens of GBs.

Page 10: Dockerize WordPress on Mac/Windows

DOCKER (CONTAINERS)

Containers include the application and all of its dependencies --but share the kernel with other containers, running as isolated processes in user space on the host operating system. Docker containers are not tied to any specific infrastructure: they run on any computer, on any infrastructure, and in any cloud.

Page 11: Dockerize WordPress on Mac/Windows

VIRTUAL MACHINES DOCKER (CONTAINERS)

Page 12: Dockerize WordPress on Mac/Windows

HOW TO USE DOCKER

ON MAC/WINDOWS?

Page 13: Dockerize WordPress on Mac/Windows

1. VIRTUALBOX + VAGRANT

Page 14: Dockerize WordPress on Mac/Windows

Boot2Docker RancherOS Barge OS

Version 1.11.2 0.4.5 2.1.5

Size 35 MB 31 MB 13 MBKernel 4.4.12 4.2.8 4.4.14

User Land Tiny Core Linux v7.1 Buildroot(glibc) + BusyBox v1.24.1 Buildroot(glibc) + BusyBox v1.24.2

Docker 1.11.2 1.10.3 1.9.1~Storage Driver aufs, etc. overlay, etc. overlay

TLS ✓ ✓ ✓Vagrant box (Third party) 0.4.1 ~ 0.4.3 ✓

VirtualBox SF 5.0.20 - 5.0.24NFS Mount (Third party) (rsync) ✓

xhyve ✓ ✓ ✓

Boot Time ~ 15s ~ 15s 5s ~ 10s

LIGHTWEIGHT DOCKER HOSTS FOR VAGRANT

https://gist.github.com/ailispaw/da3ea53c1f42569770e0

Page 15: Dockerize WordPress on Mac/Windows

2. DOCKER TOOLBOX

Page 16: Dockerize WordPress on Mac/Windows

WHAT’S IN THE TOOLBOX- Docker Engine- Docker Compose- Docker Machine- Kitematic

Page 17: Dockerize WordPress on Mac/Windows

KITEMATIC- Docker GUI- Fast and Easy Setup- Docker Hub Integration- Seamless Experience Between

CLI and GUI

Page 18: Dockerize WordPress on Mac/Windows

3. DOCKER FOR MAC/WINDOWS

Page 19: Dockerize WordPress on Mac/Windows

WHAT’S IN DOCKER FOR MAC/WINDOWS- Docker Engine- Docker CLI Client- Docker Compose- Docker Machine

Page 20: Dockerize WordPress on Mac/Windows

HOW TO DOCKERIZE

WORDPRESS?For development only (without Docker Compose)

Page 21: Dockerize WordPress on Mac/Windows

DOCKERFILE, DOCKER IMAGE,

AND DOCKER CONTAINER- Write Dockerfiles- Build Docker images from Dockerfiles- Run Docker containers from Docker images

Page 22: Dockerize WordPress on Mac/Windows

WHAT DO WE NEED IN DOCKER IMAGES- Web server- PHP- MySQL- WordPress Core- WP-CLI (recommended)

Page 23: Dockerize WordPress on Mac/Windows

BEST PRACTICES FOR WRITING DOCKERFILES- Containers should be ephemeral- Use a .dockerignore file- Avoid installing unnecessary packages- Run only one process per container- Minimize the number of layers- Sort multi-line arguments- Build cache

Page 24: Dockerize WordPress on Mac/Windows

FROM A DOCKERFILE

https://github.com/wckr/wordpress-dockerfile

$ docker build https://github.com/wckr/wordpress-dockerfile.git

Page 25: Dockerize WordPress on Mac/Windows

FROM DOCKER HUB

Page 26: Dockerize WordPress on Mac/Windows

DOCKER HUBDocker Hub is a cloud hosted service from Docker that provides registry capabilities for public and private content.

Page 27: Dockerize WordPress on Mac/Windows

USING DOCKER CLI

$ docker pull wocker/wordpress

Page 28: Dockerize WordPress on Mac/Windows

FROM KITEMATIC

Page 29: Dockerize WordPress on Mac/Windows

THANK YOU!