Professional Documents
Culture Documents
Contents
¢ Understanding application
containers * Containers and Nano
Server
* Windows Server containers versus Hyper-V
containers * Docker and Kubernetes
* Working with containers
1. Understanding application containers
* We know that containers share resources and are spun up from the
same base image, while still keeping their processes separated
so that the underlying operating system can't negatively affect
the application and also so that the application can't tank the
host operating system.
* But how is the isolation handled from a networking aspect?
¢ Well, application containers utilize technology from the
Hyper-V virtual switch in order to keep everything straight
on the networking side.
* In fact, as you start to use containers, you will quickly
see that each container has a unique IP address assigned
to it in order to maintain isolation at this level.
1.3. Scalability
Welcome to Docker
Hub Here area few
things to get you
started
|
Docker Hub
Create a
Repository
Push container
images to
©
© 6
Create an
Organizati
on
Manage Docker Hub repostorwiieths
u y te
o am
r
4.3. Docker Trusted Registry
(eee mn hse sg
4.4. Kubernetes
Docker Commands
* Once Docker is installed on your system, whether you are
working with a Windows Server 2019 or a Windows 10 machine,
you now have the Docker Engine running on your machine and
it is ready to accept some commands in order to begin
working with containers.
* If there is a single word to remember when it comes to
working with containers, it is Docker.
* That is because every command that you issue to interact
with containers will begin with the word docker. Let's have
a look are some of the common commands that you will be
working with.
5.2. Installing Docker for Windows
Docker Commands *
docker --help
* The help function for Docker will generate a list of the
possible docker commands that are available to run. This is
a good reference point as you get started.
5.2. Installing Docker for Windows
Docker Commands *
docker images
¢ After downloading some container images from a repository
(we will do this for ourselves in the next section of this
chapter), you can use the docker images command to view all
of the images that are available on your local system.
5.2. Installing Docker for Windows
Docker Commands
¢ docker search
* Utilizing the search function allows you to search the
container repositories (such as Docker Hub) for base
container images that you might want to utilize in your
environment.
* For example, in order to search and find images provided
from inside Microsoft's Docker Hub repository, issue the
following:
¢ docker search microsoft
5.2. Installing Docker for Windows
Docker Commands ¢
docker pull
* We can use docker pull to pull down container images
from online repositories.
* There are multiple repositories from which you can get
container images. Most often, you will be working with
images from Docker Hub, which is where we will pull a
container image from shortly.
* However,there are online repositories from which you can
containe other images, get Microsoft's public container
r as MCR. such as registry, known
5.2. Installing Docker for Windows
Docker Commands
* Here are some sample docker pull commands showing how to
pull container images from Docker Hub, as well as MCR:
* docker Microsoft\nanoserver
pull
Microsoft\windowsservercore
* docker
pull
* docker pull mcr.microsoft.com/windows/servercore:1809
image
pull mcr.microsoft.com/windows/nanoserver:1809
* docker
image
5.2. Installing Docker for Windows
Docker Commands ¢
docker run
* This is the command for starting a new container from a base
image.
* You will find that you can retain multiple container
images in your local repository that are all based off
the same container image.
5.2. Installing Docker for Windows
Docker Commands *
docker run
* You may have numerous container images that are all
named windowsservercore, for example.
* In this case, container tags become very important, as tags
help you to distinguish between different versions of those
container images. As an example, here is acommand that would
start a container based on a windowsservercore image for
which | had associated the
Itsc2019 tag:
* docker run -it --rm Microsoft\windowsservercore:ltsc2019
5.2. Installing Docker for Windows
Docker Commands *
docker ps -a
* You utilize docker ps when you want to view the
containers that are currently running on your system.
5.2. Installing Docker for Windows
Docker Commands
* docker info
* This will summarize your Docker environment, including the
number of containers that you have running and additional
information about the host platform itself.
5.3. Downloading a container image
IMAGE ID
5.3. Downloading a container image
PowerShell Ba
5.4. Running a container