Docker Networking Cookbook
eBook - ePub

Docker Networking Cookbook

  1. 378 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Docker Networking Cookbook

About this book

60 practical recipes that help you gain expertise with Docker networking and understand the underlying constructs that make it all work

About This Book

  • Enhance your Docker networking skills and protect your organization using advanced networking functions
  • Learn how to use third party tools to extend Docker networking
  • This practical and recipe-based book demonstrates the different ways in which you can network containers leveraging the Docker engine.

Who This Book Is For

The book is for system administrators as well as developers who are well versed with the concepts of Docker and have basic knowledge of Docker networking. You should also have sound knowledge of networking in general.

What You Will Learn

  • Configure Linux networking primitives used by Docker networking
  • Build and deploy user-defined Docker networks
  • Examine the different options for resolving and linking containers
  • Implement custom networks for Docker to consume
  • Discover third-party networking plugins such as Weave and Flannel
  • Work through solutions to secure Docker containers and networks
  • Observe methodologies for troubleshooting container networks
  • Explore advanced and experimental Docker networking features

In Detail

Networking functionality in Docker has changed considerably since its first release, evolving to offer a rich set of built-in networking features, as well as an extensible plugin model allowing for a wide variety of networking functionality. This book explores Docker networking capabilities from end to end. Begin by examining the building blocks used by Docker to implement fundamental containing networking before learning how to consume built-in networking constructs as well as custom networks you create on your own. Next, explore common third-party networking plugins, including detailed information on how these plugins inter-operate with the Docker engine. Consider available options for securing container networks, as well as a process for troubleshooting container connectivity.

Finally, examine advanced Docker networking functions and their relevant use cases, tying together everything you need to succeed with your own projects.

Style and approach

This practical recipe-based book will take readers to next level of Docker networking. It covers relevant use cases and the advanced features of Docker

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Docker Networking Cookbook by Jon Langemak in PDF and/or ePUB format, as well as other popular books in Computer Science & Cyber Security. We have over one million books available in our catalogue for you to explore.

Information

Docker Networking Cookbook


Table of Contents

Docker Networking Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why Subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Linux Networking Constructs
Introduction
Working with interfaces and addresses
Getting ready
How to do it…
Configuring Linux host routing
Getting ready
How to do it…
Exploring bridges
Getting ready
How to do it…
Making connections
Getting ready
How to do it…
Exploring network namespaces
Getting ready
How to do it…
2. Configuring and Monitoring Docker Networks
Introduction
Verifying host-level settings that impact Docker networking
Getting ready
How to do it…
Connecting containers in bridge mode
Getting ready
How to do it…
Exposing and publishing ports
Getting ready
How to do it…
Connecting containers to existing containers
Getting ready
How to do it…
Connecting containers in host mode
Getting ready
How to do it…
Configuring service-level settings
Getting ready
How to do it…
docker0 bridge addressing
Docker interface binding for published ports
Container interface MTU
Container default gateway
3. User-Defined Networks
Introduction
Viewing the Docker network configuration
Getting ready
How to do it…
Bridge
None
Host
Creating user-defined networks
Getting ready
How to do it…
Connecting containers to networks
Getting ready
How to do it…
Defining a user-defined bridge network
Getting ready
How to do it…
Example 1
Example 2
Creating a user-defined overlay network
Getting ready
A key-value store
Linux kernel version of 3.16
Open ports
Docker service configuration options
How to do it…
Isolating networks
Getting ready
How to do it…
Creating internal user-defined bridges
Creating internal user-defined overlays
4. Building Docker Networks
Introduction
Manually networking containers
Getting ready
How to do it…
Specifying your own bridge
Getting ready
How to do it…
Using an OVS bridge
Getting ready
How to do it…
Using an OVS bridge to connect Docker hosts
Getting ready
How to do it…
OVS and Docker together
Getting ready
How to do it…
5. Container Linking and Docker DNS
Introduction
Verifying a host-based DNS configuration inside a container
Getting ready
How to do it…
Overriding the default name resolution settings
Getting ready
How to do it…
Configuring links for name and service resolution
Getting ready
How to do it…
Leveraging Docker DNS
Getting ready
How to do it…
Creating Docker DNS aliases
Getting ready
How to do it…
6. Securing Container Networks
Introduction
Enabling and disabling ICC
Getting ready
How to do it…
Disabling outbound masquerading
Getting ready
How to do it…
Managing netfilter to Docker integration
Getting ready
How to do it…
Manually creating the required iptables rules
Creating custom iptables rules
Getting ready
How to do it…
Exposing services through a load balancer
Getting ready
How to do it…
7. Working with Weave Net
Introduction
Installing and configuring Weave
Getting ready
How to do it…
Running Weave-connected containers
Getting ready
How to do it…
Understanding Weave IPAM
Getting ready
How to do it…
Working with WeaveDNS
Getting ready
How to do it…
Weave security
Getting ready
How to do it…
Using the Weave network plugin
Getting ready
How to do it…
8. Working with Flannel
Introduction
Installing and configuring Flannel
Getting ready
How to do it…
Integrating Flannel with Docker
Getting ready
How to do it…
Using the VXLAN backend
Getting ready
How to do it…
Using the host gateway backend
Getting ready
How to do it…
Specifying Flannel options
Getting ready
How to do it…
9. Exploring Network Features
Introduction
Working with prerelease versions of Docker
Getting ready
How to do it…
Understanding MacVLAN interfaces
Getting ready
How to do it…
Working with the Docker MacVLAN network driver
Getting ready
How to do it…
Understanding IPVLAN interfaces
Getting ready
How to do it…
Working with the Docker IPVLAN network driver
Getting ready
How to do it…
Tagging VLAN IDs with MacVLAN and IPVLAN networks
Getting ready
How to do it…
10. Leveraging IPv6
Introduction
IPv6 command-line basics
Getting ready
How to do it…
Enabling IPv6 capabilities in Docker
Getting ready
How to do it…
Working with IPv6-enabled containers
Getting ready
How to do it…
Configuring NDP proxying
Getting ready
How to do it…
User-defined networks and IPv6
Getting ready
How to do it…
11. Troubleshooting Docker Networks
Introduction
Using tcpdump to verify network paths
Getting ready
How to do it…
Verifying VETH pairs
Getting ready
How to do it…
Verifying published ports and outbound masquerading
Getting ready
How to do it…
Verifying name resolution
Getting ready
How to do it…
Building a test container
Getting ready
How to do it…
Resetting the local Docker network database
Getting ready
How to do it…
Index

Docker Networking Cookbook

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: November 2016
Production reference: 1231116
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78646-114-8
www.packtpub.com

Credits

Author
Jon Langemak
Reviewer
Francisco Souza
Commissioning Editor
Priya Singh
Acquisition Editor
Rahul Nair
Content Development Editor
Rashmi Suvarna
Technical Editor
Mohd Riyan Khan
Copy Editor
Dipti Mankame
Project Coordinator
Judie Jose
Proofreader
Safis Editing
Indexer
Pratik Shirodkar
Graphics
Kirk D'Penha
Production Coordinator
Deepika Naik
Cover Work
Deepika Naik

About the Author

Jon Langemak has over 10 years of experience in designing, building, and maintaining high-performance networks. He is passionate about network operations, automation, and open source tooling. His current focus is on disruptive technologies and the impact they have on network operations. Outside of work, Jon blogs at dasblinkenlichten.com and enjoys collaborating with others in the network community on new ideas and concepts.

Table of contents

  1. Docker Networking Cookbook