O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Build Your Own PaaS with Docker

Book Description

Create, modify, and run your own PaaS with modularized containers using Docker

In Detail

Docker is a great tool in many ways for developers and people in DevOps.

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 is a walk in the park.

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.

By the end of the book, you will know how to create such a container on a Wordpress/MySQL platform, among others.

What You Will Learn

  • Create your own custom Docker images to fit your needs
  • Host your Docker repositories on GitHub and publicly publish them on Docker Registry Hub
  • Separate data from services using data volume containers
  • Install Docker on any platform including Amazon EC 2
  • Pass parameters to your containers when they start, to load different configurations
  • Export and back up data from shared data volume containers
  • Reverse proxy traffic to the right container using Nginx

Table of Contents

  1. Build Your Own PaaS with Docker
    1. Table of Contents
    2. Build Your Own PaaS with Docker
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Installing Docker
      1. What is Docker?
      2. Docker on Ubuntu Trusty 14.04 LTS
        1. Upgrading Docker on Ubuntu Trusty 14.04 LTS
        2. User permissions
      3. Docker on Mac OS X
        1. Installation
        2. Upgrading Docker on Mac OS X
      4. Docker on Windows
        1. Installation
        2. Upgrading Docker on Windows
      5. Docker on Amazon EC2
        1. Installation
        2. Open ports
        3. Upgrading Docker on Amazon EC2
        4. User permissions
        5. Displaying Hello World
      6. Summary
    9. 2. Exploring Docker
      1. The Docker image
      2. The Docker container
      3. The Docker command-line interface
      4. The Docker Registry Hub
        1. Browsing repositories
        2. Exploring published images
      5. Summary
    10. 3. Creating Our First PaaS Image
      1. The WordPress image
      2. Moving from the defaults
      3. Our objective
        1. Preparing for caching
        2. Raising the upload limit
        3. Plugin installation
      4. Making our changes persist
      5. Hosting image sources on GitHub
      6. Publishing an image on the Docker Registry Hub
        1. Automated builds
      7. Summary
    11. 4. Giving Containers Data and Parameters
      1. Data volumes
        1. Mounting a host directory as a data volume
        2. Mounting a data volume container
        3. Backing up and restoring data volumes
      2. Creating a data volume images
        1. Data volume image
          1. Exposing mount points
          2. The Dockerfile
      3. Hosting on GitHub
      4. Publishing on the Docker Registry Hub
      5. Running a data volume container
      6. Passing parameters to containers
      7. Creating a parameterized image
      8. Summary
    12. 5. Connecting Containers
      1. Manually connecting containers
      2. Exploring the contents of a data volume container
      3. Connecting containers using Docker Compose
        1. Installing Docker Compose
        2. Basic Docker Compose commands
          1. Service
          2. Using the run command
          3. Using the scale command
        3. Setting up our PaaS with Docker Compose
      4. Connecting containers using Crane
        1. Installing Crane
        2. Usage
        3. Configuration
      5. Summary
    13. 6. Reverse Proxy Requests
      1. Explaining the problem
      2. Finding a solution
      3. Implementing the solution
        1. Implementation with HAProxy
          1. Installing HAProxy
          2. Configuring HAProxy
          3. Adding more domains to HAProxy
        2. Implementation with Nginx
          1. Installing Nginx
          2. Configuring Nginx
          3. Adding more domains to Nginx
      4. Automating the process of mapping domains
      5. Summary
    14. 7. Deployment on Our PaaS
      1. The problem with our current setup
      2. The tools/services available
      3. Dokku – Docker-powered mini-Heroku
        1. Installation
        2. Creating a sample Dokku app
        3. How Dokku works
          1. The receive process
        4. Dokku plugins
          1. Dokku domains plugin
          2. Dokku-docker-options
          3. Volume plugin for Dokku
          4. Dokku-link
          5. MariaDB plugin for Dokku
      4. Setting up a WordPress app with Dokku
        1. Starting multiple apps
        2. Adding a domain to Dokku
        3. More notes on Dokku
      5. Summary
    15. 8. What's Next?
      1. What is a Twelve-Factor app?
      2. Flynn
      3. Deis
      4. Rocket
      5. Orchestration tools
      6. Summary
    16. Index