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

Hosting on GitHub


When we use our knowledge on how to host Docker image sources on GitHub and how to publish images on the Docker Registry Hub, it'll be no problem creating our data volume image.

Let's create a branch and a Dockerfile and add the content for our data volume image:

git checkout -b data
vi Dockerfile
git add Dockerfile

On line number 2 in the preceding code, you can use the text editor of your choice. I just happen to find vi suits my needs. The content you should add to the Dockerfile is this:

FROM busybox:latest
MAINTAINER Oskar Hane <[email protected]>
RUN mkdir /var/lib/mysql && mkdir /var/www/html
VOLUME ["/var/lib/mysql", "/var/www/html"]

Replace the maintainer information with your name and e-mail.

You can—and should—always ensure that it works before committing and pushing to GitHub. To do so, you need to build a Docker image from your Dockerfile:

docker build –t data-test .

Make sure you notice the dot at the end of the line, which means that Docker should...