E-Book, Englisch, 266 Seiten
Poulton Docker Deep Dive
2. Auflage 2023
ISBN: 978-1-83508-791-6
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection
Zero to Docker in a Single Book
E-Book, Englisch, 266 Seiten
ISBN: 978-1-83508-791-6
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection
No detailed description available for "Docker Deep Dive".
Autoren/Hrsg.
Fachgebiete
Weitere Infos & Material
Table of Contents - Part 1 - The Big Picture Stuff - Containers from 30,000 Feet
- Docker
- Installing Docker
- The big picture
- Part 2 - The Technical Stuff - The Docker Engine
- Images
- Containers
- Containerizing an app
- Multi-container apps with Compose
- Docker Swarm
- Docker Networking
- Docker overlay networking
- Volumes and persistent data
- Deploying apps with Docker Stacks
- Security in Docker
- What next
3: Installing Docker
There are lots of ways and places to install Docker. There’s Windows, Mac, and Linux. You can install in the cloud, on premises, and on your laptop. And there are manual installs, scripted installs, wizard-based installs… But don’t let that scare you. They’re all really easy, and a simple search for “how to install docker on
Docker Desktop is a desktop app from Docker, Inc. that makes it super-easy to work with containers. It includes the Docker engine, a slick UI, and an extension system with a marketplace. These extensions add some very useful features to Docker Desktop such as scanning images for vulnerabilities and making it easy to manage images and disk space. Docker Desktop is free for educational purposes, but you’ll have to pay if you start using it for work and your company has over 250 employees or does more than $10M in annual revenue. It runs on 64-bit versions of Windows 10, Windows 11, MacOS, and Linux. Once installed, you have a fully working Docker environment that’s great for development, testing, and learning. It includes Docker Compose and you can even enable a single-node Kubernetes cluster if you need to learn Kubernetes. Docker Desktop on Windows can run native Windows containers as well as Linux containers. Docker Desktop on Mac and Linux can only run Linux containers. We’ll walk through the process of installing on Windows and MacOS. Windows pre-reqs Docker Desktop on Windows requires all of the following: 64-bit version of Windows 10/11 Hardware virtualization support must be enabled in your system’s BIOS WSL 2 Be very careful changing anything in your system’s BIOS. Installing Docker Desktop on Windows 10 and 11 Search the internet or ask your AI assistant how to “install Docker Desktop on Windows”. This will take you to the relevant download page where you can download the installer and follow the instructions. You may need to install and enable the WSL 2 backend (Windows Subsystem for Linux). Once the installation is complete you may have to manually start Docker Desktop from the Windows Start menu. It may take a minute to start but you can watch the start progress via the animated whale icon on the Windows task bar at the bottom of the screen. Once it’s up and running you can open a terminal and type some simple docker commands. $ docker version Client: Cloud integration: v1.0.31 Version: 20.10.23 API version: 1.41 Go version: go1.18.10 Git commit: 7155243 Built: Thu Jan 19 01:20:44 2023 OS/Arch: linux/amd64 Context: default Experimental: true Server: Engine: Version: 20.10.23
Multipass is a free tool for creating cloud-style Linux VMs on your Linux, Mac, or Windows machine. It’s my go-to choice for Docker testing on my laptop as it’s incredibly easy to spin-up and tear-down Docker VMs. Just go to https://multipass.run/install and install the right edition for your hardware and OS. Once installed you’ll only need the following three commands: $ multipass launch $ multipass ls $ multipass shell Let’s see how to launch and connect to a new VM that will have Docker pre-installed. Run the following command to create a new VM called node1 based on the docker image. The docker image has Docker pre-installed and ready to go. $ multipass launch docker --name node1 It’ll take a minute or two to download the image and launch the VM. List VMs to make sure it launched properly. $ multipass ls Name State IPv4 Image node1 Running 192.168.64.37 Ubuntu 22.04 LTS 172.17.0.1 172.18.0.1 You’ll use the 192 IP address when working with the examples later in the book. Connect to the VM with the following command. $ multipass shell node1 You’re now logged on to the VM and can run regular Docker commands. Just type exit to log out of the VM. Use multipass delete node1 and then multipass purge to delete it. Installing Docker on Linux
There are lots of ways to install Docker on Linux and most of them are easy. The recommended way is to search the web or ask your AI how to do it. The instructions in this section may be out of date and just for guidance purposes. In this section we’ll look at one of the ways to install Docker on Ubuntu Linux 22.04 LTS. The procedure assumes you’ve already installed Linux and are logged on. Remove existing Docker packages. $ sudo apt-get remove docker docker-engine docker.io containerd runc Update the apt package index. $ sudo apt-get update $ sudo apt-get install ca-certificates curl gnupg ... Add the Docker GPG kye. $ sudo install -m 0755 -d /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg $ sudo chmod a+r /etc/apt/keyrings/docker.gpg Set-up the repository. ...