Cloud Consulting Companies

  • BIG Data & Analytics
  • CLOUD
  • Data Center
  • IOT
  • Machine Learning & AI
  • SECURITY
  • Server
  • BlockChain
  • Virtualization
You are here: Home / CLOUD / Learn how to start using Docker on Windows Server 2019

Learn how to start using Docker on Windows Server 2019

November 30, 2020 by cbn Leave a Comment

As many Windows administrators migrate both their workloads and their skills to the cloud, there’s a good chance using Docker on Windows Server 2019 will be part of that journey.

While traditional virtualization using the VMware and Hyper-V platforms still has its place, the benefits of containerized applications are difficult to ignore and might make inroads with many enterprises over the next several years. As the name implies, containers hold both the application and its dependencies. This application bundling makes containers highly portable, allowing them to run on just about every OS, as well as different cloud providers, without modification.

But this level of efficiency requires a certain level of technical proficiency. Administrators will need to learn how to use the Docker engine — the underlying container technology used in Windows Server 2019. While some container management can be done in the Windows Admin Center, Docker on Windows Server 2019 is largely driven by the command line.

Windows Server 2019 Inside Out by Orin Thomas gives an in-depth look at using the newest features and enhancements in Microsoft’s latest server OS, including core technologies such as Active Directory and the latest innovations with containers. This book contains everything needed to get started on the next stage of professional development, from basic container terminology to installing Docker on Windows Server 2019.

Once you get the container fundamentals down, Thomas covers more advanced areas, such as Kubernetes and Docker Swarm — the two types of container orchestration supported on Docker on Windows Server 2019. Orchestration handles many core management tasks, including health monitoring, failover of container hosts and application upgrades.

The following excerpt comes from Chapter 10, entitled “Containers,” from Windows Server 2019 Inside Out and explains how to perform container management using Docker on Windows Server 2019.

Managing containers

You use Docker to perform all container management tasks on computers running Windows Server. At present, the container management functionality available in Windows Admin Center is limited, but it’s likely that over time, most tasks that you can perform from the Docker prompt will be available in WAC.

Starting a container

You create a new container by specifying the container image from which you wish to create the container. You can start a container and run an interactive session either by specifying cmd.exe or PowerShell.exe by using the -it option with docker run. Interactive sessions allow you to directly interact with the container through the command line from the moment the container starts. Detached mode starts a container, but it doesn’t start an interactive session with that container.

For example, to start a container from the Microsoft/windowsservercore image and to enter an interactive PowerShell session within that container once it is started, use this command:

Docker run -it mcr.microsoft.com/windows/servercore:ltsc2019 powershell.exe

Also important is that, by default, containers use network address translation. This means that if you are running an application or service on the container that you want to expose to the network, you’ll need to configure port mapping between the container host’s network interface and the container. For example, you would run the following command if you had downloaded the Microsoft/iis container image and you wanted to start a container in Detached mode and map port 8080 on the container host to port 80 on the container.

Docker run -d -p 8080:80 mcr.microsoft.com/windows/servercore/iis:windowsservercore -ltsc2019

This is only the very basic sort of information you’d need to get started with a container, and you will learn more about container networking later in this chapter.

You can verify which containers are running by using the docker ps command … or by using the Windows Admin Center. The problem with the simple docker ps command option is that this will only show you the running containers and won’t show you any that are in a stopped state. You can see which containers are on a container host, including containers that aren’t currently running, by using the docker ps -a command.

You can also view the containers that are on a Windows Server container host using Windows Admin Center, if you have loaded the Containers extension.

One thing that you’ll notice about containers is that they appear to be assigned random names, such as sarcastic_hedgehog, dyspeptic_hamster and sententious_muppet. Docker assigns random names, rather than asking you for one, because containers are a more ephemeral type of application host than a VM; because they are likely to only have a short lifespan, it isn’t worth assigning any name that you’d need to remember. The reason for the structure of the random names is that they are easy to remember in the short term, which makes containers that you must interact with on a short-term basis easier to address than when using hexadecimal container IDs.

Editor’s note: This chapter excerpt comes courtesy of the publisher, Pearson. Windows Server 2019 Inside Out by Orin Thomas is available from the Pearson site. The publisher also offers a discount to SearchWindowsServer readers. Enter the code WINTECH at checkout to receive a 40% discount. Offer expires Dec. 31, 2021.

Share on FacebookShare on TwitterShare on LinkedinShare on Pinterest

Filed Under: CLOUD

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • March 2016
  • October 2014

Recent Posts

  • Will ChatGPT help retire me as Software Engineer anytime soon?
  • Modernize your apps and accelerate business growth with AI
  • Connect, secure, and simplify your network resources with Azure Virtual Network Manager
  • Introducing GPT-4 in Azure OpenAI Service
  • Azure Data Manager for Energy: Achieve interoperability with Petrel

Recent Comments

  • Purefit Keto Reviews on Are PDUs Your Best Platform for DCIM Instrumentation?
  • https://gemcr.org/ on 10 Things You Should Know About Deep Learning

Categories

  • BIG Data & Analytics
  • BlockChain
  • CLOUD
  • Data Center
  • IOT
  • Machine Learning & AI
  • SECURITY
  • Server
  • Uncategorized
  • Virtualization

Categories

  • BIG Data & Analytics (2,187)
  • BlockChain (490)
  • CLOUD (3,182)
  • Data Center (655)
  • IOT (2,251)
  • Machine Learning & AI (87)
  • SECURITY (1,593)
  • Server (4)
  • Uncategorized (2,017)
  • Virtualization (331)

Subscribe Our Newsletter

 Subscribing I accept the privacy rules of this site

Copyright © 2023 · News Pro Theme on Genesis Framework · WordPress · Log in