Book Image

Docker Bootcamp

By : Russ McKendrick, Pethuru Raj, Jeeva S. Chelladhurai, Vinod Singh
Book Image

Docker Bootcamp

By: Russ McKendrick, Pethuru Raj, Jeeva S. Chelladhurai, Vinod Singh

Overview of this book

<p>Docker allows you to create a robust and resilient environment to generate portable, composable, scalable, and stable application containers.</p> <p>The book starts by installing the core Docker Engine on MacOS, Windows 10 and Linux desktops. We will then define multi-container applications and understand the advantages of using containers locally. Once this is done, we will deploy containers on a single Docker host which is publicly accessible. Furthermore, we will learn how to deploy and configure a Docker Swarm cluster and explore networking and storage third-party plugins to extend the core Docker functionality. Towards the end, the book will demonstrate how to monitor and troubleshoot day-to-day problems in addition to various real world examples of container deployments.</p>
Table of Contents (15 chapters)

Preface

It's not very often a technology comes along, which is adopted so widely across an entire industry. Since its first public release in March 2013, Docker has not only gained the support of both end users, like you and I, but also industry leaders such as Amazon, Microsoft, and Google.

Docker is currently using the following sentence on their website to describe why you would want to use it:

Docker provides an integrated technology suite that enables development and IT operations teams to build, ship, and run distributed applications anywhere.

As simple as Docker's description sounds, it's been the ultimate goal for most development and IT operations teams for several years to have a tool, which can ensure that an application can consistently work across all stages of an application lifecycle, from development all the way through to production.

You will learn how to install Docker on your Operating System of choice. You will see that once Docker is installed, no matter which operating system you are using, you will get the same results when running containers.

We will then extend our Docker installation to public clouds and you will learn that no matter where you deploy your Docker hosts, the experience remains consistent and simple.

By the final chapter, you should have an idea on how Docker can be integrated into your day-to-day workflow and what your next steps with containers are going to be.

What this book covers

Chapter 1, Installing Docker Locally, works through installing the core Docker Engine as well as supporting tools on macOS, Windows 10, and Linux desktops so that you are ready for the forthcoming chapters.

Chapter 2, Launching Applications Using Docker, uses the Docker installation we installed in the previous chapter and launches containers. By the end of the chapter, we will launch a WordPress installation both manually and by using Docker Compose to define your multi-container application. We will also look at how you can publish your own images to Docker Hub.

Chapter 3, Docker in the Cloud, explains how to move away from your local installation of Docker and into public clouds. Here, we will look at launching Docker hosts in various public clouds and also deploy our applications onto them.

Chapter 4, Docker Swarm, continues to use public clouds; but rather than working with single isolated Docker hosts, we will deploy and configure a Docker Swarm cluster.

Chapter 5, Docker Plugins, speaks of the phrases used when describing Docker, which is Batteries included but removable. In this chapter, we will look at third-party plugins, which extend coreDocker functionality by adding persistent storage and multi-host networking.

Chapter 6, Troubleshooting and Monitoring, questions that, now that we have containers running locally, remotely, and within a cluster, what can go wrong? In this chapter, we will look at some of the problems you can come across. Also, we will learn how we can deploy tools to get metrics such as CPU, memory, and HDD utilization from your containers using both, first and third-party tools.

Chapter 7, Putting It All Together, emphasizes that you should now have a good understanding of what Docker is, how it works, and some possible use cases. In this chapter, we will explore how you can share container experience with colleagues as well what steps to take next.

What you need for this book

You will have to install and configure Docker17.03 (CE) on the following platforms:

  • Windows 10 Professional

  • macOS Sierra

  • Ubuntu 16.04 LTS desktop

Also, you should have access to a public cloud platform such as Digital Ocean, Amazon Web Service, or Microsoft Azure.

Who this book is for

This book targets developers, IT professionals, and DevOps engineers who like to gain intensive, hands-on knowledge, and skills with Docker without spending hours and hours in learning. If you have been struggling to find the time to gain proficiency and confidence with Docker containers and everyday Docker tasks, you have come to the right place!

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

docker container run -d \
    --name mysql \
    -e MYSQL_ROOT_PASSWORD=wordpress \
    -e MYSQL_DATABASE=wordpress \
    mysql

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

# Install the packages we need to run wp-cli
RUN apt-get update &&\
apt-get install -y sudo less mysql-client &&\

Any command-line input or output is written as follows:

curl -L "https://github.com/docker/compose/releases/download/1.10.0/docker-compose
-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /tmp/docker-compose
sudo cp /tmp/docker-compose /usr/local/bin/docker-compose

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Clicking the Next button moves you to the next screen."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Docker-Bootcamp. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.