Book Image

Build Your Own PaaS with Docker

By : Oskar Hane
Book Image

Build Your Own PaaS with Docker

By: Oskar Hane

Overview of this book

<p>Docker is a great tool in many ways for developers and people in DevOps.</p> <p>We begin by learning how easy it is to create and publish your own customized Docker images and making them available to everyone. We also see how practical it is to separate every service to its own container. When you have published separated service containers, the process of running all kinds of platforms in the same server for easier cloud computing is a walk in the park.</p> <p>This book walks you through a use case project that will teach you how to customize and create your own Docker image, allowing you to run any platform you want. The project evolves throughout the book and emerges as a complete three containers Wordpress/MySQL platform when finished.</p> <p>By the end of the book, you will know how to create such a container on a Wordpress/MySQL platform, among others.</p>
Table of Contents (15 chapters)
Build Your Own PaaS with Docker
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Manually connecting containers


Let's take a look at how to connect our service containers to our data volume container. First, we have to run our data volume container, then run our MySQL container, and lastly run our WordPress container, as shown in the following command:

docker run -d --name data-one oskarhane/data tail -f /dev/null
docker run --name mysql-one --volumes-from data-one -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql
docker run --name wordpress-one --volumes-from data-one --link mysql-one:mysql -d -p 80 oskarhane/wordpress

Here, we have fired up and named the data volume container data-one. The next line fires up the MySQL container, named mysql-one, and gives it the data volume container. The last line fires up our WordPress container, named wordpress-one, links mysql-one as the MySQL link, and gives it the data volume container.

The following output is displayed:

Open your web browser and head over to the container's URL and port in order to verify that all the services...