Getting Started with Docker - Nigel Poulton - E-Book

Getting Started with Docker E-Book

Nigel Poulton

0,0
9,49 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

2025 Edition - fully updated with the latest Docker features and an AI/LLM project!
Ready to supercharge your career and stay ahead in the fast-moving tech industry?
Dive into the latest edition of this best-selling guide by Docker Captain and industry expert Nigel Poulton. No prior experience required!
What you'll learn:
- Build essential Docker skills with hands-on projects
- Master containerization and streamline application development
- Explore how Docker is shaping the future of deploying AI/LLM applications
- Deploy and manage real-world AI solutions with Docker Compose
Why this book?
Whether you're a seasoned developer, an aspiring engineer, or transitioning into tech, this book gives you the tools to:
- Future-proof your career in the booming fields of Docker and AI
- Gain practical experience with AI chatbot deployment and model configurations
- Stand out in the industry with a deeper understanding of cutting-edge technologies
Key features:
- Step-by-step tutorials that break down complex concepts into actionable skills
- Real-world examples to manage multi-container apps and work with Docker Hub
- Crystal-clear explanations that demystify all the jargon
Your future in tech starts here.
Don't let the future pass you by - grab your copy today and unlock the tools you need to thrive in the tech industry! Your future self will thank you.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 86

Veröffentlichungsjahr: 2023

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Getting Started

with

Docker

...and AI

December 2024

Weapons-grade learning!

Nigel Poulton @nigelpoulton

About the author

Nigel Poulton (@nigelpoulton)

Nigel is a technology geek who is passionate about learning new technologies and making them easier for others to learn. He's the author of best-selling books on Docker and Kubernetes, and is the author of AI Explained: Facts, Fiction, and Future, an exciting read into the impacts of AI on society and the future of humanity. .

Nigel is a Docker Captain and has held senior technology roles at large and small enterprises.

In his free time, he listens to audiobooks and watches science fiction. He wishes he lived in the future and could explore space-time, the universe, and other mind-bending phenomena. He's passionate about learning, cars, and football (soccer). He lives in England with his fabulous wife and three children.

•LinkedIn: Nigel Poulton

•Web: nigelpoulton.com

•BlueSky: @nigelpoulton

•X: @nigelpoulton

•Email: [email protected]

Table of Contents

About the book

What does the book cover

Will the book make you an expert

Editions

Terminology and responsible language

Feedback

The sample apps

1: Intro to containers

Why containers

Big picture view

Images

Containers

Registries

The Open Container Initiative

Containers and virtual machines

Microservices

Linux containers and Windows containers

Containers and AI

Jargon recap

Chapter summary

2: Getting Docker

Docker Desktop

Multipass

Docker Hub and Docker accounts

Install the git CLI

Chapter summary

3: Running a container

Pre-reqs

Running a container

Managing containers with Docker Desktop

Chapter summary

4: Containerizing an application

Pre-reqs

Overview of the app

Test the app

Containerize the app

Test the containerized app

Clean-up

Chapter summary

5: Images and registries

Working with images

Working with registries

Multi-architecture images

AI model registries

Chapter summary

6: Multi-container apps with Compose

Application overview

The Compose file

Deploy the app

Manage the app

Chapter summary

7: Docker and AI

Pre-reqs

Chatbot overview

Deploy and test the chatbot

Use the chatbot to complete a coding task

Inspect the chatbot

Clean up

Chapter summary

8: What next

Appendix A: Lab code

Pre-reqs

Chapter 3: Running a container

Chapter 4: Containerizing an application

Chapter 5: Images and Registries

Chapter 6: Multi-container apps

Chapter 7: Docker and AI

Terminology

More from the author

Landmarks

Begin Reading

About the book

This 2025 edition of Getting Started with Docker gets you up-to-speed with Docker and AI fast!

I’ve carefully chosen the most useful topics and hand-crafted every chapter and example so the book is fun and engaging.

You’ll love the book if you’re a developer just starting with containers and AI. You’ll also love it if you work in technical marketing, sales, management, architecture, operations, and more.

What does the book cover

The book has seven main chapters packed with information and hands-on demos.

Chapter 1: You’ll learn all the important concepts and jargonChapter 2: You’ll install DockerChapter 3: You’ll deploy and manage your first containerChapter 4: You’ll containerize a simple web appChapter 5: You’ll learn about container images and Docker HubChapter 6: You’ll deploy and manage a multi-container microservices appChapter 7: You’ll use Docker to deploy a local AI chatbot, work with the chatbot, and inspect its configuration

Will the book make you an expert

No, but you’ll master the fundamentals and be ready to take the next steps on your own.

Editions

The following English language editions are available from all good book resellers:

PaperbackEbook (including Kindle)

Several translations are available but may not be as up-to-date as the original English edition.

Terminology and responsible language

The book attempts to follow guidelines from the Inclusive Naming Initiative that promote the use of responsible language.

Feedback

If you like the book and it helps your career, share the love by recommending it to a friend and leaving a review on Amazon.

If you spot a typo or want to make a recommendation, email me at [email protected].

The sample apps

This is a hands-on book with sample applications.

You can find them on GitHub at:

https://github.com/nigelpoulton/gsd-book/

Don’t stress about the apps or GitHub if you’re not a developer. The focus of the book is Docker and AI — you do not have to be a GitHub expert, nobody is ;-)

If you already have git installed, you can download the apps now with the following command. It’s OK if you don’t have git, we’ll show you how to get it and how to download the apps later in the book.

$ git clone https://github.com/nigelpoulton/gsd-book.git Cloning into 'gsd-book'... remote: Enumerating objects: 53, done. remote: Counting objects: 100% (53/53), done. remote: Compressing objects: 100% (36/36), done. remote: Total 53 (delta 18), reused 43 (delta 10), pack-reused 0 Receiving objects: 100% (53/53), 52.97 KiB | 986.00 KiB/s, done. Resolving deltas: 100% (18/18), done.

1: Intro to containers

This chapter introduces the main Docker and container concepts and level-sets the central jargon.

Don’t worry if you find some of the concepts confusing, we’ll cover everything again in more detail later in the book.

I’ve divided the chapter into the following sections:

Why containersBig picture viewImagesContainersRegistriesThe Open Container Initiative (OCI)Containers and virtual machinesMicroservicesLinux and Windows containersContainers and AI

Don’t run any of the example commands in this chapter. You’ll run plenty of commands in future chapters.

Why containers

Before we had containers, we built applications that worked on our laptops and in our development environments but often failed in production. The main reason was the differences between development and production environments — our production environments had different versions of libraries and dependencies.

Docker fixed this by creating an easy way to package applications together with their dependencies so that what you deploy to production is exactly what you developed and tested.

We’re about to find out, but the standard package is the image, and the standard runtime is the container. The image contains everything the application needs to run.

In short, Docker fixed the problem of apps not working in production and made packaging and running applications a dream!

Big picture view

Containers are the most popular way to package and run modern applications. They’re smaller, faster, and more portable than virtual machines, and they work with existing applications written in existing languages — no need to learn any new languages or frameworks!

There are two main steps to run an application as a container:

Package the app as an imageRun it as a container

The process of packaging an application as an image is called containerization. It takes the application source code, including all dependencies, and builds it into an image. This image is usually small but contains everything needed to run the app.

Once you have the image, you can use a tool like Docker to run it as a container.

Under the hood, a container is an isolated execution environment. That’s jargon for a ring-fenced part of an operating system (OS) dedicated to a single app. Figure 1.1 shows a single OS running four containers. Each container is an isolated part of the OS, each one runs a single app, and none of them knows the others exist.

Figure 1.1. Isolated execution environments.

It can be helpful to think of images as stopped containers, and containers as running images.

Figure 1.2 shows the main steps in containerizing and application. The steps are:

Develop your appBuild the app and dependencies into an imageShip the image to a registry (optional)Run it as a container
Figure 1.2

The whole process is extremely simple, and we’ll walk through it several times in the book.

That’s the big picture. Let’s dig a bit deeper.

Images

At a high level, an image is a collection of layers that comprise an application and its dependencies.

Figure 1.3 shows three layers combined into an image. The bottom layer has a minimal OS and filesystem, the middle layer has the application, and the top layer has dependencies. When stacked together, we call them an image, and they contain everything needed to run the application as a container.

Figure 1.3. Image layering.

The most common way to build an image is with a Dockerfile and the docker build command. The Dockerfile is a list of instructions that tell docker build how to build the image.

The first three lines of the following Dockerfile create the three layers shown in Figure 1.3 (base OS, app, dependencies). The fourth line is metadata telling Docker how to start the app.

FROM golang:1.20-alpine <<==== Start from base OS COPY go.mod go.sum . <<==== Copy app and dependencies RUN go mod download <<==== Install dependencies ENTRYPOINT [ "/bin/server" ] <<==== How to start the app

The following command builds a new image called my-image using a Dockerfile called Dockerfile. Don’t run the command, it’s just an example.

$ docker build -t my-image . -f Dockerfile

The build process starts at the top of the Dockerfile and steps through each instruction in turn:

Download the base OSCopy in the app and list of dependenciesInstall dependenciesSet the command to run the app.

Figure 1.4 shows a simplified version of the Dockerfile and its relationship to the image layers. Each of the three lines in the Dockerfile refers to a different layer in the image.

Figure 1.4. Dockerfiles and images.

The terms, container image, Docker image, and OCI image all mean the same thing. Usually, we just call them images.

Containers

You can start one or more containers from a single image.

Figure 1.5 shows three identical containers started from a single image.

Figure 1.5. Single image starting three containers.