This document provides step-by-step instructions for dockerizing a WordPress installation. It describes downloading Docker, creating a Dockerfile to install Apache, MySQL, PHP and WordPress, building a Docker image from the Dockerfile, running the image as a container and configuring WordPress. The summary commits the container changes to an image, tags it, and pushes it to the Docker registry so others can use it.
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerSematext Group, Inc.
Sematext engineer Rafal Kuc (@kucrafal) walks through the details of running high-performance, fault tolerant Elasticsearch clusters on Docker. Topics include: Containers vs. Virtual Machines, running the official Elasticsearch container, container constraints, good network practices, dealing with storage, data-only Docker volumes, scaling, time-based data, multiple tiers and tenants, indexing with and without routing, querying with and without routing, routing vs. no routing, and monitoring. Talk was delivered at DevOps Days Warsaw 2015.
Logical Volume Management ("LVM") on linux looks like a complicated mess at first. The basics are not all that hard, and some features like mirroring, dynamic space management, snapshots for stable backups, mirroring, and over-provisioning via thin volumes can save a lot of time and effort.
Vagrant is a well-known tool for creating development environments in a simple and consistent way. Since we adopted in our organization we experienced several benefits: lower project setup times, better shared knowledge among team members, less wtf moments ;-)
In this session we’d like to share our experience, including but not limited to:advanced vagrantfile configurationvm configuration tips for dev environment: performance,
debug, tuning,
our wtf moments
puphet/phansilbe: hot or not?
packaging a box
Raphaël Pinson's talk on "Configuration surgery with Augeas" at PuppetCamp Geneva '12. Video at http://youtu.be/H0MJaIv4bgk
Learn more: www.puppetlabs.com
Web Application Development with Quasar Framework
In this tutorial, You can see a rough development process with Quasar Framework which is known as front-end framework with VueJS components.
- Frontend : Quasar (based on Vue.js)
- Backend : Google firebase
- Result
* Web Page : https://checkin.wonyong.net
* Play Store : https://play.google.com/store/apps/details?id=org.kopochecker.app
- Youtube (Korean) : https://www.youtube.com/watch?v=HEttw-RSXxg&list=PLlWoe5hcgrk4qQVIBxDA3d-5ZRfYuITxb
Deploying your rails application to a clean ubuntu 10Maurício Linhares
Learn how you can configure a new Ubuntu 10.04 machine to run your rails application with Nginx and Unicorn in a simple way including security setup and monit monitoring.
In this talk, Michal Crosby will present on runC and Containerd, the internals and how they work together to start and manage containers in Docker. Afterwards, Arnaud Porterie will touch on about what was shipped in 1.11 and how it will enable some of the things we are working on for 1.12.
DockerCon EU 2015: Monitoring and Managing Dynamic Docker EnvironmentsDocker, Inc.
Presented by Alois Reitbauer, Chief Technical Evangelist, ruxit
This talk provides detailed insights into how to manage large-scale production Docker environments. We will cover how to tune your containerised micro services for ideal performance, validate automated deployments with Marathon and Mesos and tune and manage the deployment complexity of hundreds of nodes. Last but not least we will demonstrate how easy it is to get up and running monitoring Docker using Ruxit.
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerSematext Group, Inc.
Sematext engineer Rafal Kuc (@kucrafal) walks through the details of running high-performance, fault tolerant Elasticsearch clusters on Docker. Topics include: Containers vs. Virtual Machines, running the official Elasticsearch container, container constraints, good network practices, dealing with storage, data-only Docker volumes, scaling, time-based data, multiple tiers and tenants, indexing with and without routing, querying with and without routing, routing vs. no routing, and monitoring. Talk was delivered at DevOps Days Warsaw 2015.
Logical Volume Management ("LVM") on linux looks like a complicated mess at first. The basics are not all that hard, and some features like mirroring, dynamic space management, snapshots for stable backups, mirroring, and over-provisioning via thin volumes can save a lot of time and effort.
Vagrant is a well-known tool for creating development environments in a simple and consistent way. Since we adopted in our organization we experienced several benefits: lower project setup times, better shared knowledge among team members, less wtf moments ;-)
In this session we’d like to share our experience, including but not limited to:advanced vagrantfile configurationvm configuration tips for dev environment: performance,
debug, tuning,
our wtf moments
puphet/phansilbe: hot or not?
packaging a box
Raphaël Pinson's talk on "Configuration surgery with Augeas" at PuppetCamp Geneva '12. Video at http://youtu.be/H0MJaIv4bgk
Learn more: www.puppetlabs.com
Web Application Development with Quasar Framework
In this tutorial, You can see a rough development process with Quasar Framework which is known as front-end framework with VueJS components.
- Frontend : Quasar (based on Vue.js)
- Backend : Google firebase
- Result
* Web Page : https://checkin.wonyong.net
* Play Store : https://play.google.com/store/apps/details?id=org.kopochecker.app
- Youtube (Korean) : https://www.youtube.com/watch?v=HEttw-RSXxg&list=PLlWoe5hcgrk4qQVIBxDA3d-5ZRfYuITxb
Deploying your rails application to a clean ubuntu 10Maurício Linhares
Learn how you can configure a new Ubuntu 10.04 machine to run your rails application with Nginx and Unicorn in a simple way including security setup and monit monitoring.
In this talk, Michal Crosby will present on runC and Containerd, the internals and how they work together to start and manage containers in Docker. Afterwards, Arnaud Porterie will touch on about what was shipped in 1.11 and how it will enable some of the things we are working on for 1.12.
DockerCon EU 2015: Monitoring and Managing Dynamic Docker EnvironmentsDocker, Inc.
Presented by Alois Reitbauer, Chief Technical Evangelist, ruxit
This talk provides detailed insights into how to manage large-scale production Docker environments. We will cover how to tune your containerised micro services for ideal performance, validate automated deployments with Marathon and Mesos and tune and manage the deployment complexity of hundreds of nodes. Last but not least we will demonstrate how easy it is to get up and running monitoring Docker using Ruxit.
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Docker, Inc.
Docker Birthday App key feature improvements:
- A haproxy load balancer, based on the dockercloud/haproxy image, for dynamic configuration.
- Dockerized the locust load testing framework, in order to create fake http requests to the voting page.
- Autoscaling of the voting-app and worker containers. Using the docker remote API, I monitor the CPU usage of the two containers and scale up or down, depending on the threshold. The bottom threshold is 5% and the upper at 30%.
Tyrion Cannister Neural Styles by Dora Korpar and Siphan BouDocker, Inc.
Understanding deep learning is a real challenge, and even getting started installing software on your machine is difficult. In creating our Docker "hack", our goal was to try to make the deep learning algorithm Neural Style accessible to everyone by creating a user-friendly GUI that can be launched with one command and that optimizes the entire experience.
How to Successfully Build a Local Docker Community by Mathias RennerDocker, Inc.
A community is one of the key components of an open source software project. The success of an open source project like Docker is highly dependent on a large and active community. The speakers will share their experience of how to successfully build a local community by the example of how they raised a Docker community at their University (Univ. of Bamberg, Germany). They summon their best practices as a result of the mistakes they made, illustrated by story telling.
This is a talk from me as a student, which is an underrepresented group at DockerCon.
Monitoring Containers at New Relic by Sean Kane Docker, Inc.
New Relic went all-in with Docker very early, and has continued to stay on the forefront of the container ecosystem, both as a user of the technology and as a monitoring and analytics vendor. Today, a variety of teams utilize Docker in a variety of ways using a mix of home-grown and external OSS frameworks. The Container Fabric team is working on our next generation container platform utilizing Mesos/Marathon and a variety of other OSS tools, like Heka. We will briefly review our setup, and then discuss how we gather data that we care about from the ecosystem and inject it into the various tools we rely on for visibility and analytics. We love the functionality of what we’ve built, and we believe that you will find it useful too.
Mobycraft - Docker in 8-bit by Aditya Gupta Docker, Inc.
Mobycraft is a Minecraft client-side mod to manage and visualize Docker containers in Minecraft. This mod can be installed in any standard Minecraft client and allow young kids to learn Docker fundamentals in a fun way. It allowed a 13-year old boy to apply his Minecraft modding skills to pick up Docker concepts such as Engine, Machine, Swarm, and Remote API.
This project became a great bonding experience between a father and a son. It allowed them to engage in fun and geeky conversations, such as code reviews and tooling discussion, and thereby building memories for a lifetime.
In addition to authorization policies that control what a user can do, OpenShift Container Platform gives its administrators the ability to manage a set of security context constraints (SCCs) for limiting pods and securing their cluster.
Default security context may be too restrictive for containers pulled down from DockerHub, thorugh this talk we'll explore the various steps to execute for enabling required permissions on selected OpenShift's pods.
Deploying Windows Containers on Windows Server 2016Ben Hall
Introduction into the new Windows Containers and Windows Hyper-V Containers coming in Windows Server 2016.
Presented at WinOps Meetup #5 on Wednesday 20th April 2016. http://www.meetup.com/WinOps/events/229065341/
Preparation study for Docker Event
Mulodo Open Study Group (MOSG) @Ho chi minh, Vietnam
http://www.meetup.com/Open-Study-Group-Saigon/events/229781420/
Create Development and Production Environments with VagrantBrian Hogan
Need a Linux box to test a Wordpress site or a Windows VM to test a web site on IE 10? Creating a virtual machine to test or deploy your software doesn’t have to be a manual process. Bring one up in seconds with Vagrant, software for creating and managing virtual machines. With Vagrant, you can bring up a new virtual machine with the software you need, share directories, copy files, and configure networking using a friendly DSL. You can even use shell scripts or more powerful provisioning tools to set up your software and install your apps. Whether you need a Windows machine for testing an app, or a full-blown production environment for your apps, Vagrant has you covered.
In this talk you’ll learn to script the creation of multiple local virtual machines. Then you’ll use the same strategy to provision production servers in the cloud.
I work with Vagrant, Terraform, Docker, and other provisioning systems daily and am excited to show others how to bring this into their own workflows.
Wordpress y Docker, de desarrollo a produccionSysdig
Docker esta revolucionando cómo desplegamos nuestras aplicaciones. Desde el entorno de desarrollo hasta la puesta en producción.
Veremos las ventajas que nos aporta Docker para el desarrollo en WordPress, las herramientas y procesos desde el punto de vista de un desarrollador.
A la hora de mover nuestra aplicación WordPress a producción, presentaremos los retos que presenta y las ventajas que aportan herramientas de orquestación como Kubernetes.
Tanto si eres un desarrollador como si también tienes que gestionar los sistemas que alojan tu WordPress, saldrás de esta charla queriendo poner todos tus WordPress en contenedores.
Foundation of starting your drupal project to vagrant environmentEleison Cruz
In replace of XAMPP/MAMPP/WAMPP, here is the most matured development, Vagrant.
Vagrant makes development more stable. It eliminates differences of server setup, and what you see should be the other developers also should see.
Containerize Your Game Server for the Best Multiplayer Experience Docker, Inc.
Raymond Arifianto, AccelByte and
Mark Mandel, Google -
We have been deploying containerized micro-services for our Game Backend Services for a while. Now we are tackling the challenge to scale up fleets of game dedicated servers in multiple regions, multiple data centers and multiple providers - some in bare metal, some in Cloud. So we leverage docker containerization to deploy Game Servers to achieve Portability, Fast Deployment and Predictability, enabling us to scale up to thousands of servers, on demand, without a sweat.
How to Improve Your Image Builds Using Advance Docker BuildDocker, Inc.
Nicholas Dille, Haufe-Lexware + Docker Captain -
Docker continues to be the standard tool for building container images. For more than a year Docker ships with BuildKit as an alternative image builder, providing advanced features for secret and cache management. These features help to make image builds faster and more secure. In this session, Docker Captain Nicholas Dille will teach you how to use Buildkit features to your advantage.
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
Lukonde Mwila, Entelect -
As the cloud-native approach to development and deployment becomes more prevalent, it's an exciting time for software engineers to be equipped on how to dockerize multi-container applications and deploy them to the cloud.
In this talk, Lukonde Mwila, Software Engineer at Entelect, will cover the following topics:
- Docker Compose
- Containerizing an Nginx Server
- Containerizing an React App
- Containerizing an Node.JS App
- Containerizing anMongoDB App
- Runing Multi-Container App Locally
- Creating a CI/CD Pipeline
- Adding a build stage to test containers and push images to Docker Hub
- Deploying Multi-Container App to AWS Elastic Beanstalk
Lukonde will start by giving an overview of how Docker Compose works and how it makes it very easy and straightforward to startup multiple Docker containers at the same time and automatically connect them together with some form of networking.
After that, Lukonde will take a hands on approach to containerize an Nginx server, a React app, a NodeJS app and a MongoDB instance to demonstrate the power of Docker Compose. He'll demonstrate usage of two Docker files for an application, one production grade and the other for local development and running of tests. Lastly, he'll demonstrate creating a CI/CD pipeline in AWS to build and test our Docker images before pushing them to Docker Hub or AWS ECR, and finally deploying our multi-container application AWS Elastic Beanstalk.
Securing Your Containerized Applications with NGINXDocker, Inc.
Kevin Jones, NGNIX -
NGINX is one of the most popular images on Docker Hub and has been at the forefront of the web since the early 2000's. In this talk we will discuss how and why NGINX's lightweight and powerful architecture makes it a very popular choice for securing containerized applications as a sidecar reverse proxy within containers. We will highlight important aspects of application security that NGINX can help with, such as TLS, HTTP, AuthN, AuthZ and traffic control.
How To Build and Run Node Apps with Docker and ComposeDocker, Inc.
Kathleen Juell, Digital Ocean -
Containers are an essential part of today's microservice ecosystem, as they allow developers and operators to maintain standards of reliability and reproducibility in fast-paced deployment scenarios. And while there are best practices that extend across stacks in containerized environments, there are also things that make each stack distinct, starting with the application image itself.
This talk will dive into some of these particularities, both at the image and service level, while also covering general best practices for building and running Node applications with database backends using Docker and Compose.
Jessica Deen, Microsoft -
Helm 3 is here; let's go hands-on! In this demo-fueled session, I'll walk you through the differences between Helm 2 and Helm 3. I'll offer tips for a successful rollout or upgrade, go over how to easily use charts created for Helm 2 with Helm 3 (without changing your syntax), and review opportunities where you can participate in the project's future.
Distributed Deep Learning with Docker at SalesforceDocker, Inc.
Jeff Hajewski, Salesforce -
There is a wealth of information on building deep learning models with PyTorch or TensorFlow. Anyone interested in building a deep learning model is only a quick search away from a number of clear and well written tutorials that will take them from zero knowledge to having a working image classifier. But what happens when you need to deploy these models in a production setting? At Salesforce, we use TensorFlow models to help us provide customers with insights into their data, and we do this as close to real-time as possible. Designing these systems in a scalable manner requires overcoming a number of design challenges, but the core component is Docker. Docker enables us to design highly scalable systems by allowing us to focus on service interactions, rather than how our services will interact with the hardware. Docker is also at the core of our test infrastructure, allowing developers and data scientists to build and test the system in an end to end manner on their local machines. While some of this may sound complex, the core message is simplicity - Docker allows us to focus on the aspects of the system that matter, greatly simplifying our lives.
The First 10M Pulls: Building The Official Curl Image for Docker HubDocker, Inc.
James Fuller, webcomposite s.r.o. -
Curl is the venerable (yet very modern) 'swiss army knife' command line tool and library for transferring data with URLs. Recently we (the Curl team) decided to build a release for Docker Hub. This talk will outline our current development workflow with respect to the docker image and provide insights on what it takes to build a docker image for mass public consumption. We are also keen to learn from users and other developers how we might improve and enhance the official curl docker image.
Fabian Stäber, Instana -
In recent years, we saw a great paradigm shift in software engineering away from static monolithic applications towards dynamic distributed horizontally scalable architectures. Docker is one of the key technologies enabling this development. This shift poses a lot of new challenges for application monitoring, ranging from practical issues (need for automation) to technical challenges (Docker networking) to organizational topics (blurring line between software engineers and operations) to fundamental questions (define what is an application). In this talk we show how Docker changed the way we do monitoring, how modern application monitoring systems work, and what future developments we expect.
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...Docker, Inc.
Clemente Biondo, Engineering Ingegneria Informatica -
When the COVID 19 pandemic started, Engineering Ingegneria Informatica Group (1.25 billion euros of revenues, 65 offices around the world, 12.000 employees) was forced to put their digital transformation to the test in order to maintain operational continuity. In this session, Clemente Biondo, the Tech Lead of the Information Systems Department, will share how his company is reacting to this unforeseeable scenario and how Docker-driven digital transformation had paved the path for work to continue remotely. Clemente will discuss learnings moving from colocated teams, manual approaches, email based-business processes, and a monolithic application to a mature DevOps culture characterized by a distributed autonomous workforce and a continuous deployment process that deploys backward-compatible Docker containerized microservices into hybrid multi cloud datacenters an average of twice a day with zero-downtime. He will detail how they use Docker to unify dev, test and production environments, and as an efficient and automated mechanism for deploying applications. Lastly, Clemente shares how, in our darkest hour, he and others are working to shine their brightest light.
Chris Lauer, NOAA Space Weather Prediction Center -
This is the story of how adopting a containerized workflow changed the way our small software team works at NOAA’s Space Weather Prediction Center. Our old architecture, a big ball of mud shared-database integration, just wasn’t cutting it - it was killing our agility. Over the past two years, our small team has adopted a microservice style architecture, using Docker with docker-compose and environment files as our deployment strategy for all new development. We’ve discovered the joys of using containers for identical dev, staging, and production environments. We work closely with scientists: much of the code we’re running has complicated and conflicting library dependencies. Docker captures these beautifully - we’ve even had some success teaching our scientists to use it! I’ll share what we’ve learned, some of the persistent challenges we face, and one place we really got it wrong. This talk builds off of a popular hallway track from DockerCon 2019.
Become a Docker Power User With Microsoft Visual Studio CodeDocker, Inc.
Brian Christner, 56k + Docker Captain -
In this session, we will unlock the full potential of using Microsoft Visual Studio Code (VS Code) and Docker Desktop to turn you into a Docker Power User. When we expand and utilize the VS Code Docker plugin, we can take our projects and Docker skills to the next level. In addition to using VS Code, we streamline our Docker Desktop development workflow with less context switching and built-in shortcuts. You will learn how to bootstrap new projects, quickly write Dockerfiles utilizing templates, build, run, and interact with containers all from VS Code.
How to Use Mirroring and Caching to Optimize your Container RegistryDocker, Inc.
Brandon Mitchell, Boxboat + Docker Captain -
How do you make your builds more performant? This talk looks at options to configure caching and mirroring of images that you need to save on bandwidth costs and to keep running even if something goes down upstream.
Monolithic to Microservices + Docker = SDLC on Steroids!Docker, Inc.
Ashish Sharma, SS&C Eze -
SS&C Eze provides various products in the stock market domain. We spent the last couple of years building Eclipse which is an investment suite born in cloud. The journey so far has been very interesting. The very first version of the product were a bunch of monolithic windows services and deployed using Octopus tool. We successfully managed to bring all the monolithic problem to the cloud and created a nightmare for ourselves. We then started applying microservices architecture principles and started breaking the monolithic into small services. Very soon we realized that we need a better packaging/deployment tool. Docker looked like a magical solution to our problem. Since its adoption, It has not only solved the deployment problem for us but has made a deep impact on different aspects of SDLC. It allowed us to use heterogeneous technology stacks, simplified development environment setup, simplified our testing strategy, improved our speed of delivery, and made our developers more productive. In this talk I would like to share our experience of using Docker and its positive impact on our SDLC.
Ara Pulido, Datadog -
Container technologies, although not new, have increased their popularity in the past few years, with container orchestrators allowing companies around the world to adopt these technologies to help them ship and scale microservices with precision and velocity. Kubernetes is currently the most popular container orchestration platform, and while many organizations are migrating their workloads to it, Kubernetes is still relatively immature. New corner cases, errors, and quirks are regularly discovered as users push the boundaries of size and scale. When Datadog adopted Kubernetes we discovered some of these boundaries the hard way, and we continuously challenge and modify our infrastructure decisions in order to fit our use case. Join me in this talk for our story on what we learned while we scaled our Kubernetes clusters, the contributions to Kubernetes we made along the way, and how you can apply those learnings when growing your Kubernetes clusters from a handful to hundreds or thousands of nodes.
Andy Clemenko, StackRox -
One underutilized, and amazing, thing about the docker image scheme is labels. Labels are a built in way to document all aspects about the image itself. Think about all the information that the tags inside your clothing carry. If you care to look you can find out everything about the garment. All that information can be very valuable. Now think about how we can leverage labels to carry similar information. We can even use the labels to contain Docker Compose or even Kubernetes Yaml. We can even include labels into the CI/CD process making things more secure and smoother. Come find out some fun techniques on how to leverage labels to do some fun and amazing things.
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelDocker, Inc.
Patrick Deloulay, Micro Focus -
Micro Focus started their digital transformation 3 years ago, moving the entire portfolio into hundreds of container images. Leveraging Docker Hub as our primary registry service, we will cover how we ended up building a simple but secure push/pull model to publish and deliver our premium assets to our customers and partners to both meet the high agility of our DevOps teams while greatly simplifying the deployment of our applications.
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
Lukonde Mwila, Entelect
As the cloud-native approach to development and deployment becomes more prevalent, it's an exciting time for software engineers to be equipped on how to dockerize multi-container applications and deploy them to the cloud.
In this talk, Lukonde Mwila, Software Engineer at Entelect, will cover the following topics:
- Docker Compose
- Containerizing an Nginx Server
- Containerizing an React App
- Containerizing an Node.JS App
- Containerizing anMongoDB App
- Runing Multi-Container App Locally
- Creating a CI/CD Pipeline
- Adding a build stage to test containers and push images to Docker Hub
- Deploying Multi-Container App to AWS Elastic Beanstalk
Lukonde will start by giving an overview of how Docker Compose works and how it makes it very easy and straightforward to startup multiple Docker containers at the same time and automatically connect them together with some form of networking.
After that, Lukonde will take a hands on approach to containerize an Nginx server, a React app, a NodeJS app and a MongoDB instance to demonstrate the power of Docker Compose. He'll demonstrate usage of two Docker files for an application, one production grade and the other for local development and running of tests. Lastly, he'll demonstrate creating a CI/CD pipeline in AWS to build and test our Docker images before pushing them to Docker Hub or AWS ECR, and finally deploying our multi-container application AWS Elastic Beanstalk.
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...Docker, Inc.
Elton Stoneman, Docker Captain + Container Consultant and Trainer
How do you provide a SaaS offering when your product is a 10-year old Fortran app, currently built to run on Windows 10? With Docker and Kubernetes of course - and you can do it in a week (... to prototype level at least).
In this session I'll walk through the processes and practicalities of taking an older Windows app, making it run in containers with Kubernetes, and then building a simple API wrapper to host the whole stack as a cloud-based SaaS product.
There's a lot of technology here from a real world case study, and I'll focus on:
- running Windows apps in Docker containers
- building a .NET Core API which can run in Linux or Windows containers
- running the stack in Kubernetes with Docker Desktop locally and AKS in the cloud
- configuring AKS workloads in Azure to burst out to Azure Container Instances
And there's a core theme to this session: Docker and Kubernetes are complex technologies, but they're the key to modern development. If you invest time learning them, they make projects like this simple, portable, fast and fun.
Developing with Docker for the Arm ArchitectureDocker, Inc.
This virtual meetup introduces the concepts and best practices of using Docker containers for software development for the Arm architecture across a variety of hardware systems. Using Docker Desktop on Windows or Mac, Amazon Web Services (AWS) A1 instances, and embedded Linux, we will demonstrate the latest Docker features to build, share, and run multi-architecture images with transparent support for Arm.
2. Requirements
• In order to complete this tutorial, you should make sure that
you have docker installed. For more information about
installation please visit the Docker website:
http://docs.docker.io/en/latest/
• You should also be familiar with the dockerfile instructions
covered in the dockerfile tutorial:
http://www.docker.io/learn/dockerfile/
• In addition to WordPress, we first need to install Apache,
MySQL and PHP inside our container. To keep this presentation
straightforward all these different software will be install in one
single docker container
3. • Throughout this tutorial I use docker with Vagrant and a
VirtualBox VM on a Mac computer. To get Docker and
WordPress running, the first step is to edit our Vagrantfile
with the line in red here below:
# Setup virtual machine box. This VM configuration code is
always executed.
config.vm.box = BOX_NAME
config.vm.box_url = BOX_URI
config.vm.forward_port 80, 8880
Computers-MacBook-Air:~ communityPC$ cd docker
Computers-MacBook-Air:docker communityPC$ emacs Vagrantfile
4. • Now that we have specified in our Vagrantfile that accessing
"localhost:8080" will access port 80 on the guest machine, we
can start the VM. We see that our change here below in red
has been taken into consideration
Computers-MacBook-Air:docker communityPC$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8880 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Mounting shared folders...
[default] -- /vagrant
5. • The following command will SSH into our running VM and give
us access to a shell
• At this point it is important to become “root” to have
permission to start a container
Computers-MacBook-Air:docker communityPC$ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.8.0-29-generic x86_64)
* Documentation: https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 20 20:56:40 2013 from 10.0.2.2
vagrant@precise64:~$ sudo su
root@precise64:/home/vagrant#
6. • Lets create a new directory to proceed with our WordPress
installation
• We are now ready to open emacs and build our Dockerfile
root@precise64:/home/vagrant# mkdir wordpress
root@precise64:/home/vagrant# cd wordpress
root@precise64:/home/vagrant/wordpress#
root@precise64:/home/vagrant/wordpress# emacs Dockerfile
7. # Install LAMP stack and Wordpress
# use the latest ubuntu image
FROM ubuntu:12.04
MAINTAINER: Victor Coisne “victor.coisne@dotcloud.com"
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
# install apache, mysql, php, emacs, wget and wordpress
RUN apt-get install -y mysql-server mysql-client
RUN apt-get install -y apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libapr1 libaprutil1
libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl libpq5 mysql-common php5-common php5-mysql
RUN apt-get install -y emacs23 wget
# download the lastest version of wordpress and move the sources to the default apache serveur host /var/www
RUN wget http://wordpress.org/latest.tar.gz && mv latest.tar.gz /var/www
# Setting ports to be publicly exposed when running the image (Wordpress uses ports 80)
EXPOSE 80
• So this is how our finished Dockerfile looks like. Note that the lines starting with
# are comments that give explanation about what will happen when building a
docker container from that Dockerfile
If you are not comfortable with the Dockerfile syntax, follow this link http://www.docker.io/learn/dockerfile/
8. • It is now time to build our container from the current directory
and use the option -t to give it a name: wordpresstuto
• Now that we have built our container lets run it !
• –p 80:80 tells docker to forward port 80 from the container to
the VM and connect to that VM on the same port 80. Since we
are running the host OS inside Vagrant, the Vagrantfile that we
have modified will forward that back to port 8880 on our main
system.
root@precise64:/home/vagrant/wordpress# docker build -t wordpresstuto .
root@precise64:/home/vagrant/wordpress# docker run -i -t -p 80:80
wordpress_tuto /bin/bash
root@bd4b8fdbd37f:/#
9. • Note that port 80 should not be already in use. You can enter the
following command to be sure that there are no other processes
listening upon port 80:
• As you can see there are no processes listening upon port 80.
If there are any, you first have to kill them if you want to run
your docker container and forward port 80 from the container
to the host.
Root@precise64:/home/vagrant/wordpress# lsof -Pni4 | grep LISTEN
rpcbind 680 root 8u IPv4 948 0t0 TCP *:111 (LISTEN)
rpc.statd 726 statd 9u IPv4 8180 0t0 TCP *:48561 (LISTEN)
sshd 761 root 3u IPv4 9607 0t0 TCP *:22 (LISTEN)
memcached 930 memcache 26u IPv4 9989 0t0 TCP 127.0.0.1:11211 (LISTEN)
dnsmasq 962 lxc-dnsmasq 7u IPv4 10007 0t0 TCP 10.0.3.1:53 (LISTEN)
.
10. • Lets now go to the directory /var/www that is the location of
the website files
• Now that we are in the /var/www we can unzip the latest
version of Wordpress downloaded in our dockerfile and found
on http://codex.wordpress.org/UNIX_Shell_Skills
• The following command allow us to edit Apache’s default
configuration file
root@bd4b8fdbd37f:/var/www# tar zxf latest.tar.gz
root@bd4b8fdbd37f:/var/www# emacs /etc/apache2/sites-enabled/000-default
root@bd4b8fdbd37f:/# cd /var/www
root@bd4b8fdbd37f:/var/www#
11. • Inside that file we just have to change the Documentroot and
Directory lines as you can see here below in red
File Edit Options Buffers Tools Help
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/wordpress
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/wordpress/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
12. • First let’s start the MySQL database
• Let’s now start the Apache2 service
• It is now time to change directory to edit the Wordpress
configuration file
M
root@bd4b8fdbd37f:/var/www# /usr/sbin/mysqld &
root@bd4b8fdbd37f:/var/www# /etc/init.d/apache2 start
root@bd4b8fdbd37f:/var/www# cd wordpress
13. • At this point, if we go to the following url in our web browser:
http://localhost:8880/ we see the following message
14. • As a result we just have to move our config-sample.php file to
a newly created wp-config.php file that Wordpress needed to
get started
• Then we log in the mysql monitor as a “root” user
root@bd4b8fdbd37f:/var/www/wordpress# mv wp-config-sample.php wp-
config.php
root@bd4b8fdbd37f:/var/www/wordpress# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 7
Server version: 5.5.22-0ubuntu1 (Ubuntu)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be
trademarks of their respective owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
15. • Let’s start by creating the database we need to run WordPress
and give it a name
• It is now time to create a new user name and password prior to
grant permissions to that user for the specific database we have
just created. Once this is done we simply reload all the privileges
and exit the MySQL shell
• Lets now edit the configuration file using emacs
mysql> create database victor_wordpress ;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password’ ;
mysql> GRANT ALL PRIVILEGES ON victor_wordpress.* TO 'newuser’ @'localhost’ ;
mysql> FLUSH PRIVILEGES ;
mysql> exit
Bye
root@bd4b8fdbd37f:/var/www/wordpress# emacs wp-config.php
16. //** The name of the database for WordPress */
define('DB_NAME', 'wordpress_victor');
//** MySQL database username */
define('DB_USER', 'newuser');
//** MySQL database password */
define('DB_PASSWORD', 'password');
//** MySQL hostname */
define('DB_HOST', 'localhost');
Now that we are inside the configuration file, lets edit the mysql
settings with the information previously defined in red here
below: database name, username and password
17. • Now enter the following url in your favorite web browser: http://localhost:8880
Voilà ! You are now ready to start the Wordpress installation process.
• Wait there is one more thing to do …
18. • Don’t forget to share your work with the Docker community. To
do so we can push your container on the Docker index to store
the filesystem state and make it available for re-use.
• In order to push it on the Docker index, you first have to sign up:
https://index.docker.io/account/signup/
• So we first have to exit our container and go back to our host
root@bd4b8fdbd37f:/var/www/wordpress# exit
exit
There are stopped jobs.
root@bd4b8fdbd37f:/var/www/wordpress# exit
Exit
root@precise64:/home/vagrant/wordpress#
19. • We can use the following Docker command to find the ID of
our image (it should be the first one of the list)
• Now that we have the ID we can commit the changes we have
made to the image and tag it using your username from the
Docker index / the name of your image. Our image is now
ready to be pushed to the docker index !
• You can read more about Docker and WordPress here:
Slumlord hosting with Docker - WordPress Container
root@precise64:/home/vagrant/wordpress# docker commit bd4b8fdbd37f -t
vcoisne/wordpresstuto
93ed51f82520
root@precise64:/home/vagrant/wordpress# docker push vcoisne/wordpresstuto
root@precise64:/home/vagrant# docker ps -a
ID IMAGE COMMAND CREATED STATUS
bd4b8fdbd37f wordpresstuto:latest /bin/bash 11 minutes ago Exit 0
20. Want to learn more ?
http://www.docker.io/news_signup/
https://twitter.com/docker/
https://github.com/dotcloud/docker
http://stackoverflow.com/search?q=docker
https://botbot.me/freenode/docker/#
https://groups.google.com/forum/#!forum
/docker-user
https://plus.google.com/u/1/communities/
108146856671494713993
https://www.facebook.com/docker.run
Editor's Notes
Explain that port 80 should not be already in use otherwise lsof -Pni4 | grep LISTEN