SlideShare uma empresa Scribd logo
1 de 20
Dockerizing WordPress
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
• 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
• 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
• 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#
• 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
# 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/
• 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:/#
• 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)
.
• 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#
• 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>
• 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
• At this point, if we go to the following url in our web browser:
http://localhost:8880/ we see the following message
• 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>
• 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
//** 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
• 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 …
• 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#
• 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
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

Mais conteúdo relacionado

Mais procurados

Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with DockerGeeta Vinnakota
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerSematext Group, Inc.
 
Squid proxy-configuration-guide
Squid proxy-configuration-guideSquid proxy-configuration-guide
Squid proxy-configuration-guidejasembo
 
Installation Openstack Swift
Installation Openstack SwiftInstallation Openstack Swift
Installation Openstack Swiftymtech
 
Making Your Capistrano Recipe Book
Making Your Capistrano Recipe BookMaking Your Capistrano Recipe Book
Making Your Capistrano Recipe BookTim Riley
 
Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Jun Hong Kim
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsBen Hall
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Praguetomasbart
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersBen Hall
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Squid Proxy Server
Squid Proxy ServerSquid Proxy Server
Squid Proxy Server13bcs0012
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOpsОмские ИТ-субботники
 
App development with quasar (pdf)
App development with quasar (pdf)App development with quasar (pdf)
App development with quasar (pdf)wonyong hwang
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Maurício Linhares
 
httpd — Apache Web Server
httpd — Apache Web Serverhttpd — Apache Web Server
httpd — Apache Web Serverwebhostingguy
 

Mais procurados (20)

Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
 
Squid proxy-configuration-guide
Squid proxy-configuration-guideSquid proxy-configuration-guide
Squid proxy-configuration-guide
 
Squid Server
Squid ServerSquid Server
Squid Server
 
Installation Openstack Swift
Installation Openstack SwiftInstallation Openstack Swift
Installation Openstack Swift
 
Making Your Capistrano Recipe Book
Making Your Capistrano Recipe BookMaking Your Capistrano Recipe Book
Making Your Capistrano Recipe Book
 
Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Putting some "logic" in LVM.
Putting some "logic" in LVM.Putting some "logic" in LVM.
Putting some "logic" in LVM.
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Linux
LinuxLinux
Linux
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
Squid Proxy Server
Squid Proxy ServerSquid Proxy Server
Squid Proxy Server
 
Apache Web Server Setup 4
Apache Web Server Setup 4Apache Web Server Setup 4
Apache Web Server Setup 4
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
App development with quasar (pdf)
App development with quasar (pdf)App development with quasar (pdf)
App development with quasar (pdf)
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10
 
httpd — Apache Web Server
httpd — Apache Web Serverhttpd — Apache Web Server
httpd — Apache Web Server
 

Destaque

Docker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker, Inc.
 
DockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
DockerCon EU 2015: Monitoring and Managing Dynamic Docker EnvironmentsDockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
DockerCon EU 2015: Monitoring and Managing Dynamic Docker EnvironmentsDocker, Inc.
 
LXC to Docker Via Continuous Delivery
LXC to Docker Via Continuous DeliveryLXC to Docker Via Continuous Delivery
LXC to Docker Via Continuous DeliveryDocker, Inc.
 
How to Use Your Own Private Registry
How to Use Your Own Private RegistryHow to Use Your Own Private Registry
How to Use Your Own Private RegistryDocker, Inc.
 
Introduction to Docker I Docker Workshop @ Twitter
Introduction to Docker I Docker Workshop @ TwitterIntroduction to Docker I Docker Workshop @ Twitter
Introduction to Docker I Docker Workshop @ TwitterDocker, Inc.
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Docker, Inc.
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013Docker, Inc.
 
Distributed, Real-time Web Apps
Distributed, Real-time Web AppsDistributed, Real-time Web Apps
Distributed, Real-time Web AppsDocker, Inc.
 
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Docker, Inc.
 
Tyrion Cannister Neural Styles by Dora Korpar and Siphan Bou
Tyrion Cannister Neural Styles by Dora Korpar and Siphan BouTyrion Cannister Neural Styles by Dora Korpar and Siphan Bou
Tyrion Cannister Neural Styles by Dora Korpar and Siphan BouDocker, Inc.
 
DockerCon14 Contributing to Docker by Tianon
DockerCon14 Contributing to Docker by TianonDockerCon14 Contributing to Docker by Tianon
DockerCon14 Contributing to Docker by TianonDocker, Inc.
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryDocker, Inc.
 
How to Successfully Build a Local Docker Community by Mathias Renner
How to Successfully Build a Local Docker Community by Mathias RennerHow to Successfully Build a Local Docker Community by Mathias Renner
How to Successfully Build a Local Docker Community by Mathias RennerDocker, Inc.
 
Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2Docker, Inc.
 
DockerCon SF 2015: Maintaining the official node.js docker image
DockerCon SF 2015: Maintaining the official node.js docker imageDockerCon SF 2015: Maintaining the official node.js docker image
DockerCon SF 2015: Maintaining the official node.js docker imageDocker, Inc.
 
DockerCon14 John Engates
DockerCon14 John EngatesDockerCon14 John Engates
DockerCon14 John EngatesDocker, Inc.
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker, Inc.
 
Monitoring Containers at New Relic by Sean Kane
Monitoring Containers at New Relic by Sean Kane Monitoring Containers at New Relic by Sean Kane
Monitoring Containers at New Relic by Sean Kane Docker, Inc.
 
Mobycraft - Docker in 8-bit by Aditya Gupta
Mobycraft - Docker in 8-bit by Aditya Gupta Mobycraft - Docker in 8-bit by Aditya Gupta
Mobycraft - Docker in 8-bit by Aditya Gupta Docker, Inc.
 

Destaque (20)

Docker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF Meetup
 
DockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
DockerCon EU 2015: Monitoring and Managing Dynamic Docker EnvironmentsDockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
DockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
 
LXC to Docker Via Continuous Delivery
LXC to Docker Via Continuous DeliveryLXC to Docker Via Continuous Delivery
LXC to Docker Via Continuous Delivery
 
How to Use Your Own Private Registry
How to Use Your Own Private RegistryHow to Use Your Own Private Registry
How to Use Your Own Private Registry
 
Introduction to Docker I Docker Workshop @ Twitter
Introduction to Docker I Docker Workshop @ TwitterIntroduction to Docker I Docker Workshop @ Twitter
Introduction to Docker I Docker Workshop @ Twitter
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
 
Distributed, Real-time Web Apps
Distributed, Real-time Web AppsDistributed, Real-time Web Apps
Distributed, Real-time Web Apps
 
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
 
Tyrion Cannister Neural Styles by Dora Korpar and Siphan Bou
Tyrion Cannister Neural Styles by Dora Korpar and Siphan BouTyrion Cannister Neural Styles by Dora Korpar and Siphan Bou
Tyrion Cannister Neural Styles by Dora Korpar and Siphan Bou
 
DockerCon14 Contributing to Docker by Tianon
DockerCon14 Contributing to Docker by TianonDockerCon14 Contributing to Docker by Tianon
DockerCon14 Contributing to Docker by Tianon
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software Delivery
 
Docker Links
Docker LinksDocker Links
Docker Links
 
How to Successfully Build a Local Docker Community by Mathias Renner
How to Successfully Build a Local Docker Community by Mathias RennerHow to Successfully Build a Local Docker Community by Mathias Renner
How to Successfully Build a Local Docker Community by Mathias Renner
 
Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2
 
DockerCon SF 2015: Maintaining the official node.js docker image
DockerCon SF 2015: Maintaining the official node.js docker imageDockerCon SF 2015: Maintaining the official node.js docker image
DockerCon SF 2015: Maintaining the official node.js docker image
 
DockerCon14 John Engates
DockerCon14 John EngatesDockerCon14 John Engates
DockerCon14 John Engates
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
 
Monitoring Containers at New Relic by Sean Kane
Monitoring Containers at New Relic by Sean Kane Monitoring Containers at New Relic by Sean Kane
Monitoring Containers at New Relic by Sean Kane
 
Mobycraft - Docker in 8-bit by Aditya Gupta
Mobycraft - Docker in 8-bit by Aditya Gupta Mobycraft - Docker in 8-bit by Aditya Gupta
Mobycraft - Docker in 8-bit by Aditya Gupta
 

Semelhante a Dockerizing WordPress

[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context ConstraintsAlessandro Arrichiello
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Ben Hall
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 
EWD 3 Training Course Part 42: The QEWD Docker Appliance
EWD 3 Training Course Part 42: The QEWD Docker ApplianceEWD 3 Training Course Part 42: The QEWD Docker Appliance
EWD 3 Training Course Part 42: The QEWD Docker ApplianceRob Tweed
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Rich Bowen
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using DockerRuss Mckendrick
 
Docker fundamentals
Docker fundamentalsDocker fundamentals
Docker fundamentalsAlper Unal
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionSysdig
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4Hojin Kim
 
Foundation of starting your drupal project to vagrant environment
Foundation of starting your drupal project to vagrant environmentFoundation of starting your drupal project to vagrant environment
Foundation of starting your drupal project to vagrant environmentEleison Cruz
 
Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesSreenivas Makam
 
Docker workshop
Docker workshopDocker workshop
Docker workshopEvans Ye
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Rich Bowen
 
Introction to docker swarm
Introction to docker swarmIntroction to docker swarm
Introction to docker swarmHsi-Kai Wang
 
Docker-Presentation.pptx
Docker-Presentation.pptxDocker-Presentation.pptx
Docker-Presentation.pptxVipobav
 

Semelhante a Dockerizing WordPress (20)

[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
EWD 3 Training Course Part 42: The QEWD Docker Appliance
EWD 3 Training Course Part 42: The QEWD Docker ApplianceEWD 3 Training Course Part 42: The QEWD Docker Appliance
EWD 3 Training Course Part 42: The QEWD Docker Appliance
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
 
Network Manual
Network ManualNetwork Manual
Network Manual
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
 
Docker fundamentals
Docker fundamentalsDocker fundamentals
Docker fundamentals
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccion
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
Foundation of starting your drupal project to vagrant environment
Foundation of starting your drupal project to vagrant environmentFoundation of starting your drupal project to vagrant environment
Foundation of starting your drupal project to vagrant environment
 
moscmy2016: Extending Docker
moscmy2016: Extending Dockermoscmy2016: Extending Docker
moscmy2016: Extending Docker
 
Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting Techniques
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010
 
Introction to docker swarm
Introction to docker swarmIntroction to docker swarm
Introction to docker swarm
 
Docker-Presentation.pptx
Docker-Presentation.pptxDocker-Presentation.pptx
Docker-Presentation.pptx
 

Mais de Docker, Inc.

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Docker, Inc.
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildDocker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXDocker, Inc.
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeDocker, Inc.
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDocker, Inc.
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubDocker, Inc.
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices WorldDocker, Inc.
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...Docker, Inc.
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with DockerDocker, Inc.
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeDocker, Inc.
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryDocker, Inc.
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Docker, Inc.
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog ScaleDocker, Inc.
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels Docker, Inc.
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelDocker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...Docker, Inc.
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDocker, Inc.
 

Mais de Docker, Inc. (20)

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker Build
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINX
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and Compose
 
Hands-on Helm
Hands-on Helm Hands-on Helm
Hands-on Helm
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at Salesforce
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker Hub
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices World
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with Docker
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio Code
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container Registry
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog Scale
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm Architecture
 

Dockerizing WordPress

  • 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

Notas do Editor

  1. Explain that port 80 should not be already in use otherwise lsof -Pni4 | grep LISTEN