Sathyajith Bhat
Practical Docker with Python Build, Release and Distribute your Python App with Docker
Sathyajith Bhat
Bangalore, Karnataka, India
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book's product page, located at www.apress.com/978-1-4842-3783-0 . For more detailed information, please visit http://www.apress.com/source-code .
ISBN 978-1-4842-3783-0 e-ISBN 978-1-4842-3784-7
https://doi.org/10.1007/978-1-4842-3784-7
Library of Congress Control Number: 2018952361
Sathyajith Bhat 2018
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
To my parents, Jayakar and Jyothika Bhat, who have unconditionally supported me throughout my entire life.
Introduction
Docker has exploded in popularity and has become the de facto target as a containerization image format as well as a containerization runtime. With modern applications getting more and more complicated, the increased focus on microservices has led to adoption of Docker, as it allows for applications along with their dependencies to be packaged into a file as a container that can run on any system. This allows for faster turnaround times in application deployment and less complexity and it negates the chances of the it-works-on-my-server-but-not-on-yours problem.
Practical Docker with Python covers the fundamentals of containerization, gets you acquainted with Docker, breaks down terminology like Dockerfile and Docker Volumes, and takes you on a guided tour of building a chatbot using Python. Youll learn how to package a traditional application as a Docker Image.
Book Structure
This book is divided into seven chapterswe start the first chapter with a brief introduction to Docker and containerization. We then take a 101 class of Docker, including installing, configuring, and understanding some Docker jargon. In Chapter , we take a look at our project and look at how to configure our chatbot.
In Chapters , we dive into the meat of Docker, focusing on Dockerfiles, Docker Networks, and Docker Volumes. These chapters include practical exercises on how to incorporate each of these into the project. Finally, we take a look at Docker Compose and see how we can run multi-container applications.
Acknowledgments
Thank you to my wife, Jyothsna, for being patient and supporting me in my career and while writing this book.
I would like to thank Nikhil Karkal, Siddhi Chavan, and Divya Modi from Apress for helping me immensely through all stages of the book.
I would like to thank my technical reviewer, Swapnil Kulkarni, for providing pertinent feedback.
I would also like to acknowledge the immense support provided by Saurabh Minni, Ninad Pundalik, Prashanth H. N., Mrityunjay Iyer, and Abhijith Gopal over the past couple of years.
About the Author and About the Technical Reviewer
About the Author
Sathyajith Bhat
is a seasoned DevOps/SRE professional currently working as a DevOps engineer on Adobe I/O, which is Adobes developer ecosystem and community. Prior to this, he was the lead Ops/SRE at Styletag.com. He transitioned to Ops/SRE after being a lead analyst at CGI, working primarily on Oracle Fusion stack (Oracle DB/PL/SQL/Oracle Forms and other related middleware) designing, architecting, and implementing complete end-to-end solutions for a major insurance provider in the Nordics.
In his free time, Sathya is part of the Barcamp Bangalore planning team, handling DevOps and Social Media for BCB. Sathya is also a co-organizer of the AWS Users Group Bangalore, organizing monthly meetups and workshops and occasionally speaking at them. He is also a volunteer Community Moderator at Super User and Web Apps Stack Exchange, keeps the servers for the Indian Video Gamer forums up and running, and was previously a moderator for Chip-India and Tech 2 forums.
You can reach out to Sathya from these links:
Email: sathya@sathyasays.com
Blog: https://sathyasays.com
Twitter: https://twitter.com/sathyabhat
LinkedIn: https://linkedin.com/in/sathyabhat
About the Technical Reviewer
Swapnil Kulkarni
is a cloud architect and open source enthusiast with experience in Blockchain, cloud native solutions, containers, and enterprise software product architectures. He has diverse experiences in different private, hybrid cloud architectures with Amazon Web Services, Azure, OpenStack, CloudStack, and IBM Cloud, to name a few. He is an Active Technology Contributor (ATC) in OpenStack, spanning across multiple projects. Hes also core reviewer in the OpenStack Kolla and OpenStack Requirements Project. He has contributed to different open source communities, including OpenStack, Docker, and Kubernetes, and has multiple upcoming open source platforms for containerization. Swapnil has also presented at multiple OpenStack summitsLinuxCon and ContainerCon to name a few. Swapnil shares his tech views and experiments on his blog mentioned here. He is also a technical reviewer for multiple publication houses in emerging technologies and has a passion for learning and implementing different concepts. You can reach out to him via email or connect with him on his social media handles.