Docker A Project-Based Approach to Learning (Jason Cannon) (Z-Library)
Statistics
6
Views
0
Downloads
0
Donations
Uploader

高宏飞

Shared on 2025年12月13日
Actions

Docker A Project-Based Approach to Learning (Jason Cannon) (Z-Library)

其他

AuthorJason Cannon

No description

Publish Year: 2021
Language: 英文
Pages: 246
File Format: PDF
File Size: 1.8 MB
Support Statistics
¥.00 · 0times
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

(This page has no text content)
D O C K E R A Project-Based Approach to Learning Jason Cannon LinuxTrainingAcademy.com
Copyright © 2021 Jason Cannon All rights reserved No part of this book may be reproduced, or stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without express written permission of the publisher.
CONTENTS Title Page Copyright Online Resources Introduction and Overview Installing Docker Introduction to Docker Docker Basics and Common Commands Managing Docker Container Images Exercise: Managing Images Running and Managing Docker Containers Exercise: Running Containers Making a Container Publicly Available Exercise: Making a Container Publicly Available Connecting to Running Containers and Managing Container Output Exercise: Entering and Connecting to Containers Docker Logging Docker Registries Building Images with Dockerfiles Exercise: Build and Push an Image Docker Volumes Exercise: Managing Docker Volumes
Docker Networking and Dockerizing Applications Exercise: Docker Networking Docker Swarm Exercise: Deploying a Private Docker Registry The End and the Beginning Other Books by the Author Courses by the Author
ONLINE RESOURCES To download all the exercises contained in this book, as well as additional resources, visit https://www.LinuxTrainingAcademy.com/docker. Any updates or corrections to this book will be shared there as well.
INTRODUCTION AND OVERVIEW Welcome to this book on Docker, where you'll learn the ins-and-outs of the world's most popular container platform. My name is Jason Cannon, and I'm the author of several best-selling Linux books, including Linux for Beginners and Command Line Kung Fu. I've also created dozens of courses that have helped people just like you level-up their careers by teaching them valuable, in-demand skills. I've been using Docker since its release, and I've put all of my best Docker tips, tricks, and techniques into this book. In order for you to get Docker up and running as quickly as possible, the beginning of the book will show you how to install it on your chosen operating system. It will outline how to start, stop, and resume containers, how to display important information about those containers, and how to use the built-in Docker help system. From there, you'll learn all about Docker images: what images are, where to get them, how to manage them, and even how to create your very own custom images. You’ll also learn how to create a private Docker image registry, so you can have complete control over your images in your environment. If you're worried about keeping sensitive data out of the wrong hands, you can deploy a private registry. Next, you'll learn how to manage the data needed by and created by your Docker containers. You'll learn about the different ways to persist data between container runs, including how to make the most of Docker volumes. Plus, you'll find out how to view and manage the output and logs generated by your containers. I will demonstrate how Docker supervises network traffic, including how it
routes traffic from the outside world to and from a given container, and how it isolates containers for greater security. Most importantly, you'll learn why, when, and how to create and manage Docker networks for your specific needs and applications. Having taught thousands of students over the years, I’ve found that people learn best by doing. To help you with this, there are practice exercises throughout the book, each with detailed, step-by-step instructions. Not only will you learn the concepts, you will be able to put those concepts to good use by practicing these new skills immediately so that you fully understand and retain what you're learning. Each project and exercise will allow you to build upon the skills you've acquired along the way. By the end of this book, you'll be able to deploy complex applications using multi-container configurations, user-defined networks, and Docker volumes with ease. This book is ideal for anyone who has a desire to learn how to configure, deploy, and manage Docker systems, Docker containers, Docker registries, Docker orchestrators, or Dockerized applications. Whether you're a developer, programmer, or a software engineer looking for best-practices to deploy your applications quickly and easily using Docker; or a System Administrator, Systems Engineer, or Operations Engineer who needs to support Docker deployments, this book is for you. Ultimately, this is the perfect guide for those who are looking to advance their careers by learning a key DevOps Skill: Docker. So, if you're tired of being scared of Docker, or simply aren't making the progress you'd hope for by dabbling with Docker containers, it's time to take your Docker skills to the next level by reading this book.
INSTALLING DOCKER In this chapter, you will learn which edition of Docker to install and why. It can be a relatively complicated choice for newcomers to Docker, as there are so many options. Here, we will cover the differences between the available versions, so you can decide which best suits your requirements. Additionally, you'll learn how to install Docker on various operating systems, including Windows, Mac, and Linux. Docker Community Edition vs. Docker Enterprise Edition The two main versions of the Docker Engine promoted by Docker today are ‘Docker CE’, which is the Community Edition, and ‘Docker EE’, which is the Enterprise Edition. This book is based on the Community Edition, as it is suitable for individuals, small teams of developers, and even large organizations that want to run Docker without paying a subscription fee. In short, the Community Edition is free for anyone to download and run. The Enterprise Edition provides additional premium features that are not included in the Community Edition, such as being able to verify that images created by vendors are trustworthy and verified. These images are certified by ISVs (Independent Software Vendors), and work seamlessly with Docker Enterprise Edition. The Docker Enterprise Edition is a commercial product, available for a fee. Another Docker offering is ‘Docker Enterprise’, which is not related to the Docker Engine, but rather a container platform with a full suite of extras. These extras include the ability to scan container images for common vulnerabilities, as well as access to an orchestrator such as Docker Swarm or Kubernetes. Docker Community Edition Channels There are three types of update channels for Docker CE. The most commonly
used is the stable update channel, which contains software that has been thoroughly tested. The second channel is called ‘test’, and contains software that hasn't yet completed testing. Finally, the nightly channel contains the most recent work in progress. We will focus on the stable channel, as we want to ensure our Docker environment has been thoroughly tested and works. If you install from a nightly build, for example, you may run into unexpected bugs and other issues. Again, I highly recommend using the stable channel unless you are testing a new feature that Docker hasn't yet promoted to the stable version. One thing to note is that releases of Docker CE are supported through patches that are available for approximately seven months after each version’s release. Docker EE extends that support to approximately twenty-four months after a new version is released. Installing Docker on Windows In this section, you're going to learn how to install Docker on Windows. If you want to install Docker on another operating system, such as Mac or Linux, skip ahead to the section that corresponds to your operating system. Before you install Docker on Windows, let's discuss some requirements. At the time of publication, Docker requires at least Windows 10 Pro, Windows 10 Enterprise, or Windows 10 Education Edition. Currently, Docker is not supported on Windows 10 Home Edition. Also, Docker requires that virtualization be enabled in your physical computer's BIOS. Sometimes it's labeled as VT-x for Intel processors or AMD-V for AMD processors. This varies depending on the manufacturer, so consult the documentation for your specific computer. Luckily, this is usually already enabled, but if you run into any issues, double check and make sure that virtualization is enabled in your BIOS. Note that this is different from having Hyper-V enabled. These virtualization settings are at the hardware level, not at the operating system level. Also, be aware that Docker and other virtualization software such as VirtualBox or VMWare can't run on the same host at the same time. Download Docker Desktop for Windows
First download Docker. At the time of publication, the direct download link is: https://desktop.docker.com/win/stable/amd64/Docker%20Desktop%20Installer.exe This may change over time, so if the link does not work, go to https://www.docker.com and find the download section of the website to get Docker for your operating system. Install Docker Desktop Once you have downloaded the installation file, run it. Docker requires administrative privileges to perform the installation, so be sure that you're logged in as a user who has administrative privileges on your Windows system. Accept the defaults. Click “OK” to continue.
Next, click "OK."
Close and log out when you're prompted to. You'll be logged out of your Windows system, and will have to log back in to continue the installation process.
Once you have logged back into your system, double-click the Docker Desktop icon on your desktop:
Alternatively, you can start Docker Desktop by using the search bar to find it. You will see a message that Docker is starting. A small Docker icon will also
appear in your task bar. If you do not have Hyper-V already installed, Docker will do this for you. When prompted to install Hyper-V, click "OK". At this point, your system may need to reboot to complete the installation. During this initial phase, you will have to manually start Docker by double- clicking on the Docker Desktop icon.
To check the status of Docker, look in the menu bar. For example, the image below says that Docker desktop is starting. Give Docker Desktop a few minutes to start. Once Docker has been successful at completely installing and running, a pop-up message like this will appear:
Click "X" to dismiss the message. Use the command line to verify that Docker is working properly. First, open a
command prompt as administrator. One way to do this is to click in the search bar and type in "command". Once you have "Command Prompt" highlighted, click on "Run as administrator." By the way, you can also use PowerShell and run that as administrator. Once you are at the command line, run the following command: docker version If Docker is installed and working, you will see the following information displayed on your screen:
Congratulations! You've installed Docker on Windows! Going forward, remember that you need to run the Command Prompt or PowerShell as Administrator in order to interact with Docker successfully. Installing Docker on Mac In this section, you will learn how to install Docker on a Mac. If you want to install Docker on another operating system, skip ahead to the section that applies to your specific operating system.
The above is a preview of the first 20 pages. Register to read the complete e-book.