Skip to content
Tech Shizz Logo

An Engineers Blog

  • TechShizz
  • blog

Installing and working with Windows Containers in Server 2016

Posted on February 23, 2021 By rich No Comments on Installing and working with Windows Containers in Server 2016

Installing Docker

First, Install “Containers” Feature from Windows Features.

Run PowerShell as administrator:

## Install the module, pull down from internet
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
##Say yes to install Nuget
## Install the package
Install-Package -Name Docker -ProviderName DockerMsftProvider
##Confirm install.
#Reboot

Installing the base OS

You can do this either in PowerShell or CMD (as admin)

docker pull microsoft/nanoserver
OR
docker pull microsoft/windowsservercore

Containers are created in the file system here: C:ProgramDataDockerContainers

Here are some basic commands:
docker images – Shows the current images available.
docker run -it mimcrosoft/nanoserver cmd – Runs a new container with a nanoserver base and runs CMD. You can see the container running in C:ProgramDataDockerContainers. If you type “hostname” you’ll see the hostname is infact a new one, not the name of your physical host.

docker ps -a – Shows all containers currently running on the server and the container ID.

If you “exit” from the cmd, this will stop the container since no processes are running.

If the container stops, you can start it again with:
docker start <containerid>

If you wanted to get into a cmd in the container again you could do:
docker exec -it <containerid> cmd

docker commit <containerid> <name>
docker commit 11dfds1sf1 containerone

docker run –rm <name> <command> — –rm removes the container once finished.

Post navigation

❮ Previous Post: Get server or computer memory usage via PowerShell (Ideal for server core)
Next Post: One Drive character limit | PowerShell to find file path character length | File Path Character Limit ❯

Leave a Reply Cancel reply

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

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Subscribe to our newsletter!

Recent Posts

  • How to implement a lightning-fast ransomware playbook
  • How to achieve defence in depth in your business
  • How to implement a SecOps team phishing response plan
  • How to block an Office 365 Sign-in correctly
  • Microsoft finally patched serious Exchange 0-day over a month old!

Recent Comments

    Archives

    • November 2022
    • July 2021
    • March 2021
    • February 2021

    Categories

    • Cyber Security
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Copyright © 2023 .

    Theme: Oceanly News Dark by ScriptsTown