Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Docker for Serverless Applications
Docker for Serverless Applications

Docker for Serverless Applications: Containerize and orchestrate functions using OpenFaas, OpenWhisk, and Fn

Arrow left icon
Profile Icon Chanwit Kaewkasi
Arrow right icon
$24.99 $35.99
eBook Apr 2018 250 pages 1st Edition
eBook
$24.99 $35.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Chanwit Kaewkasi
Arrow right icon
$24.99 $35.99
eBook Apr 2018 250 pages 1st Edition
eBook
$24.99 $35.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$24.99 $35.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Docker for Serverless Applications

Docker and Swarm Clusters

In this chapter, we will review container technology and introduce Docker and its orchestration engine, as well as Docker Swarm mode. We will then discuss why we need a Docker infrastructure to deploy and run serverless and FaaS applications. The topics covered in this chapter are as follows:

  • Containers and Docker
  • Setting up a Docker Swarm cluster
  • Performing container networking with Docker
  • Why Docker fits into the serverless and FaaS infrastructure

What is a container?

Before talking about Docker, it would be better to discuss the technology behind the software container.

Virtual machines are a common virtualization technology and have been widely adopted by cloud providers and enterprise companies. Actually, a software container (or container for short) is also a kind of virtualization technology, but there is something different about them. The key difference is that every container shares the same kernel on the host machine, while each virtual machine has its own kernel. Basically, a container uses virtualization techniques at the level of the operating system, not the hypervisor. The following diagram shows a comparison between container and VM stacks:

Figure 2.1: Containers versus virtual machines

Linux's container technology heavily relies on two important kernel capabilities, namespace and...

What is Docker?

Containers in the past were quite difficult to manage and use. Docker is basically a set of technologies to help us prepare, manage, and execute containers. In the world of virtual machines, we need a hypervisor to take care of all VM instances. Similarly, in the world of containers, we use Docker as the container engine to take care of everything to do with containers.

Undeniably, Docker is the most popular container engine to date. When using Docker, we follow the three concepts build, ship, and run, recommended by Docker itself:

  • The workflow of Build-Ship-Run is optimized by the philosophy of Docker. In the Build step, we are allowed to build and destroy container images rapidly. As developers, we can include the container building steps as a part of our development cycle.
  • In the Ship step, we ship container images to places, from our development...

Docker Swarm clusters

A cluster is a group of machines connecting together to do work. A Docker host is a physical or virtual machine with the Docker Engine installed. We create a Docker Swarm cluster by connecting many Docker hosts together. We refer to each Docker host as a Docker Swarm node, simply a node.

In version 1.12, Docker introduced Swarm mode, a new orchestration engine to replace the old Swarm cluster, which is now referred to as Swarm classic. The main difference between Swarm classic and Swarm mode is that Swarm classic uses an external service, such as Consul, etcd, or Apache ZooKeeper as its key/value store, but Swarm mode has this key/value built in. With this, Swarm mode keeps orchestration latency at a minimum, and is more robust than Swarm classic because it does not need to interact with an external store. The monolithic nature of Swarm mode is...

Exercises

To help you better remember and understand the concepts and practices of Docker described in this chapter, try answering the following questions without going back to the chapter's contents. Let's get started:

  1. What are containers? What's the key difference between containers and virtual machines?
  2. What are the main features inside the Linux kernel to enable container technology? Please name at least two of them.
  3. What are the key concepts of the Docker workflow?
  4. What is a Dockerfile for? Which Docker command do you use to interact with it?
  5. What is the ENTRYPOINT instruction inside a Dockerfile?
  6. Which command do we use to list all Docker images?
  1. Which command do we use to form a Docker Swarm cluster?
  2. What is the key difference between Swarm classic and Swarm mode?
  3. Please explain the relationship between services and tasks.
  4. How can we create an...

Summary

This chapter started off by discussing the concepts of containers. Then we reviewed what Docker is, how to install it, and the Docker build, ship, and run workflow. We then learnt how to form a Docker Swarm cluster and Swarm master and worker nodes. We learnt how to properly set up a robust Swarm cluster with an odd number of master nodes. We then learnt the service and task concepts of Docker Swarm. Finally, we learnt how Docker fits into serverless application development.

In the next chapter, we will review serverless frameworks and platforms to understand the overall architecture and the limitations of them.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • - Implement containerization in Serverless/FaaS environments
  • - Utilize Docker as a functional unit of work for Serverless/FaaS platforms
  • - Use Docker as a portable infrastructure for Serverless Applications

Description

Serverless applications have gained a lot of popularity among developers and are currently the buzzwords in the tech market. Docker and serverless are two terms that go hand-in-hand. This book will start by explaining serverless and Function-as-a-Service (FaaS) concepts, and why they are important. Then, it will introduce the concepts of containerization and how Docker fits into the Serverless ideology. It will explore the architectures and components of three major Docker-based FaaS platforms, how to deploy and how to use their CLI. Then, this book will discuss how to set up and operate a production-grade Docker cluster. We will cover all concepts of FaaS frameworks with practical use cases, followed by deploying and orchestrating these serverless systems using Docker. Finally, we will also explore advanced topics and prototypes for FaaS architectures in the last chapter. By the end of this book, you will be in a position to build and deploy your own FaaS platform using Docker.

Who is this book for?

If you are a Developer, a Docker Engineer, a DevOps Engineer, or any stakeholder interested in learning the use of Docker on Serverless environments then this book is for you.

What you will learn

  • • Learn what Serverless and FaaS applications are
  • • Get acquainted with the architectures of three major serverless systems
  • • Explore how Docker technologies can help develop Serverless applications
  • • Create and maintain FaaS infrastructures
  • • Set up Docker infrastructures to serve as on-premises FaaS infrastructures
  • • Define functions for Serverless applications with Docker containers

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 19, 2018
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781788837576
Vendor :
Docker
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 19, 2018
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781788837576
Vendor :
Docker
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 131.97
Deployment with Docker
$43.99
Learn Docker - Fundamentals of Docker 18.x
$43.99
Docker for Serverless Applications
$43.99
Total $ 131.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Serverless and Docker Chevron down icon Chevron up icon
Docker and Swarm Clusters Chevron down icon Chevron up icon
Serverless Frameworks Chevron down icon Chevron up icon
OpenFaaS on Docker Chevron down icon Chevron up icon
The Fn Project Chevron down icon Chevron up icon
OpenWhisk on Docker Chevron down icon Chevron up icon
Operating FaaS Clusters Chevron down icon Chevron up icon
Putting Them All Together Chevron down icon Chevron up icon
The Future of Serverless Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.