Book Image

Windows Server 2019 Cookbook - Second Edition

By : Mark Henderson, Jordan Krause
Book Image

Windows Server 2019 Cookbook - Second Edition

By: Mark Henderson, Jordan Krause

Overview of this book

Do you want to get up and running with essential administrative tasks in Windows Server 2019? This second edition of the Windows Server 2019 Cookbook is packed with practical recipes that will help you do just that. The book starts by taking you through the basics that you need to know to get a Windows Server operating system working, before teaching you how to navigate through daily tasks using the upgraded graphical user interface (GUI). You'll then learn how to compose an optimal Group Policy and perform task automation with PowerShell scripting. As you advance, you’ll get to grips with faster app innovation, improved Windows security measures, and hybrid cloud environments. After you’ve explored the functions available to provide remote network access to your users, you’ll cover the new Hyper-V enhancements. Finally, this Windows Server book will guide you through practical recipes relating to Azure integration and important tips for how to manage a Windows Server environment seamlessly. By the end of this book, you’ll be well-versed with Windows Server 2019 essentials and have the skills you need to configure Windows services and implement best practices for securing a Windows Server environment.
Table of Contents (18 chapters)

Changing the container networking

We've seen a lot in this chapter about how to get our containers working smoothly and reliably. But what we haven't looked at is how to configure the networking. We've been using the -p flag, but what does it do? And what else can we do with our container networking?

Getting started

We need our Windows Server 2019 server that's running containers.

How to do it…

Follow these steps to change the container networking:

  1. On your Windows server, open PowerShell as an Administrator.
  2. We don't need to do anything complicated to demonstrate this recipe, so let's just start by running the test IIS site:
    docker run -d -p 8000:80 mcr.microsoft.com/windows/servercore/iis
  3. This starts our IIS container and makes it accessible on port 8000. You can browse to it with http://localhost:8000.
  4. But what if we didn't want it running on port 8000? After all, that's not a particularly convenient port...