Practical Docker with Python - Sathyajith Bhat

Practical Docker with Python (eBook)

Build, Release and Distribute your Python App with Docker

(Autor)

eBook Download: PDF
2018 | 1st ed.
XV, 186 Seiten
Apress (Verlag)
978-1-4842-3784-7 (ISBN)
Systemvoraussetzungen
39,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen
Learn the key differences between containers and virtual machines. Adopting a project based approach, this book introduces you to a simple Python application to be developed and containerized with Docker.

After an introduction to Containers and Docker you'll be guided through Docker installation and configuration.  You'll also learn basic functions and commands used in Docker by running a simple container using Docker commands. 

The book then moves on to developing a Python based Messaging Bot using required libraries and virtual environment where you'll add Docker Volumes to your project, ensuring your container data is safe. 
You'll create a database container and link your project to it and finally, bring up the Bot-associated database all at once with Docker Compose. 

What You'll Learn
  • Build, run, and distribute Docker containers
  • Develop a Python App and containerize it
  • Use Dockerfile to run the Python App
  • Define and run multi-container applications with Docker Compose 
  • Work with persisting data generated by and used by Docker containers
Who This Book Is For

Intermediate developers/DevOps practitioners who are looking to improve their build and release workflow by containerizing applications



Sathyajith Bhat is a seasoned DevOps/SRE professional currently working as a DevOps Engineer on Adobe I/O, which is Adobe's 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. He is also a volunteer Community Moderator at Super User and Web Apps Stack Exchange, keeps the servers for Indian Video Gamer forums up and running, and was previously a Moderator for Chip-India and Tech 2 forums.

Learn the key differences between containers and virtual machines. Adopting a project based approach, this book introduces you to a simple Python application to be developed and containerized with Docker.After an introduction to Containers and Docker you'll be guided through Docker installation and configuration.  You'll also learn basic functions and commands used in Docker by running a simple container using Docker commands. The book then moves on to developing a Python based Messaging Bot using required libraries and virtual environment where you'll add Docker Volumes to your project, ensuring your container data is safe. You'll create a database container and link your project to it and finally, bring up the Bot-associated database all at once with Docker Compose. What You'll LearnBuild, run, and distribute Docker containersDevelop a Python App and containerize itUse Dockerfile to run the Python AppDefine and run multi-container applications with Docker Compose Work with persisting data generated by and used by Docker containersWho This Book Is ForIntermediate developers/DevOps practitioners who are looking to improve their build and release workflow by containerizing applications

Sathyajith Bhat is a seasoned DevOps/SRE professional currently working as a DevOps Engineer on Adobe I/O, which is Adobe’s 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. He is also a volunteer Community Moderator at Super User and Web Apps Stack Exchange, keeps the servers for Indian Video Gamer forums up and running, and was previously a Moderator for Chip-India and Tech 2 forums.

Table of Contents 5
About the Author 8
About the Technical Reviewer 9
Acknowledgments 10
Introduction 11
Chapter 1: Introduction to  Containerization 12
What Is Docker? 12
Docker the Company 12
Docker the Software Technology 13
Understanding Problems that Docker Solves 13
Containerization Through the Years 15
1979: chroot 15
2000: FreeBSD Jails 15
2005: OpenVZ 15
2006: cgroups 16
2008: LXC 16
Knowing the Difference Between Containers and Virtual Machines 16
Summary 19
Chapter 2: Docker 101 20
Installing Docker 20
Installing Docker on Windows 21
Installing on MacOS 23
Installing on Linux 24
Additional Steps 25
Understanding Jargon Around Docker 27
Layers 27
Docker Image 28
Docker Container 28
Bind Mounts and Volumes 29
Docker Registry 29
Dockerfile 30
Docker Engine 31
Docker Daemon 31
Docker CLI 31
Docker API 33
Docker Compose 34
Docker Machine 34
Hands-On Docker 35
Working with Docker Images 37
Working with a Real-World Docker Images 41
Summary 49
Chapter 3: Building the Python App 50
About the Project 50
Setting Up Telegram Messenger 51
BotFather: Telegram’s Bot Creation Interface 53
Creating the Bot with BotFather 54
Newsbot: The Python App 57
Installing Dependencies of Newsbot 57
Running Newsbot 58
Sending Messages to Newsbot 59
Summary 62
Chapter 4: Understanding the Dockerfile 63
Dockerfile 63
Build Context 64
Dockerignore 65
Building Using Docker Build 66
Dockerfile Instructions 69
FROM 70
WORKDIR 71
ADD and COPY 75
RUN 77
CMD and ENTRYPOINT 79
Gotchas About Shell and Exec Form 82
ENV 83
VOLUME 85
EXPOSE 85
LABEL 88
Guidelines and Recommendations for Writing Dockerfiles 89
Multi-Stage Builds 90
Dockerfile Exercises 91
Summary 99
Chapter 5: Understanding Docker Volumes 100
Data Persistence 100
Example of Data Loss Within Docker Container 101
tmpfs Mounts 103
Bind Mounts 104
Volumes 108
Docker Volume Subcommands 109
Create Volume 109
Inspect 110
List Volumes 111
Prune Volumes 111
Remove Volumes 111
Using Volumes When Starting a Container 112
VOLUME Instruction in Dockerfile 115
Docker Volume Exercises 116
Summary 127
Chapter 6: Understanding Docker Networks 128
Why Do We Need Container Networking? 128
Default Docker Network Drivers 129
Bridge Network 129
Host Network 130
Overlay Network 131
Macvlan Networks 131
None Networking 131
Working with Docker Networks 132
Bridge Networks 136
Creating Named Bridge Networks 141
Connecting Containers to Named Bridge Networks 146
Host Networks 150
Docker Networking Exercises 151
Summary 159
Chapter 7: Understanding Docker Compose 160
Overview of Docker Compose 160
Installing Docker Compose 162
Docker Compose Basics 163
Compose File Versioning 163
Version 1 164
Version 2 164
Version 3 164
Docker Compose File Reference 168
Services 168
build 168
context 169
image 169
environment/env_file 169
depends_on 170
image 171
ports 171
volumes 172
Restart 174
Docker Compose CLI Reference 175
build 175
down 175
exec 175
logs 176
stop 176
Docker Volume Exercises 176
Summary 191
Index 192

Erscheint lt. Verlag 26.7.2018
Zusatzinfo XV, 186 p. 33 illus.
Verlagsort Berkeley
Sprache englisch
Themenwelt Informatik Programmiersprachen / -werkzeuge Python
Mathematik / Informatik Informatik Software Entwicklung
Mathematik / Informatik Informatik Web / Internet
Schlagworte build • compose • containers • deploy • DevOps • Docker • Python • Release • Volumes
ISBN-10 1-4842-3784-6 / 1484237846
ISBN-13 978-1-4842-3784-7 / 9781484237847
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 3,0 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
ein kompakter Einstieg für die Praxis

von Ralph Steyer

eBook Download (2024)
Springer Vieweg (Verlag)
34,99
Arbeiten mit NumPy, Matplotlib und Pandas

von Bernd Klein

eBook Download (2023)
Carl Hanser Verlag GmbH & Co. KG
29,99