Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows Server 2019 Cookbook

You're reading from   Windows Server 2019 Cookbook Over 100 recipes to effectively configure networks, manage security, and administer workloads

Arrow left icon
Product type Paperback
Published in Jul 2020
Publisher Packt
ISBN-13 9781838987190
Length 650 pages
Edition 2nd Edition
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Jordan Krause Jordan Krause
Author Profile Icon Jordan Krause
Jordan Krause
Mark Henderson Mark Henderson
Author Profile Icon Mark Henderson
Mark Henderson
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Chapter 1: Learning the Interface 2. Chapter 2: Core Infrastructure Tasks FREE CHAPTER 3. Chapter 3: Networking 4. Chapter 4: Working with Certificates 5. Chapter 5: Internet Information Services 6. Chapter 6: Remote Access 7. Chapter 7: Remote Desktop Services 8. Chapter 8: Monitoring and Backup 9. Chapter 9: System Insights 10. Chapter 10: Group Policy 11. Chapter 11: File Services and Data Control 12. Chapter 12: Server Core 13. Chapter 13: Working with Hyper-V 14. Chapter 14: Containers and Docker 15. Chapter 15: Desired State Configuration and Automation 16. Chapter 16: Hardening Your Infrastructure 17. Other Books You May Enjoy

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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image