Docker Networking Cookbook
eBook - ePub

Docker Networking Cookbook

Jon Langemak

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

Docker Networking Cookbook

Jon Langemak

Book details
Book preview
Table of contents
Citations

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

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is Docker Networking Cookbook an online PDF/ePUB?
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 & Operating Systems. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781786461148
Edition
1

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