To begin, update your system to ensure full compatibility between applications installed,
Next, we install the docker package,
yum install docker-io
Once the install finishes, start the docker service,
service docker start
You can configure Docker to automatically start on-boot/reboot as well, using chkconfig,
chkconfig docker on
Done! The basic install of Docker on CentOS 6 is complete
In this example, we'll be using Dockers official Wordpress image to setup and use.
Let's run docker first, remember to change “password” to something else before using,
docker run --name wordpress -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress -d mysql:5.7
Download the Docker Wordpress image,
docker pull wordpress
Build+Start the Wordpress docker container, change “password” to what ever you had set on the earlier step.
docker run -e WORDPRESS_DB_PASSWORD=password -d --name wordpress --link wordpressdb:mysql wordpress
Done! Visit your VPS/dedicated servers IP address in your browser and it should display the Wordpress setup/install page!
You may run into an error saying port 80 is currently use, in this case stop your webserver, which would most likely be apache/httpd with the following command and then re-try deploying from the “Build+Start” step above,
service httpd stop