Skip to content

microsoft/containers-toolkit

Repository files navigation

Table of contents

  1. Introduction
  2. Usage
  3. TODO
  4. Contribution
  5. References

Introduction

Containers-Toolkit is a Windows PowerShell module for downloading, installing, and setting up default configs for Containerd, BuildKit, Windows CNI plugin, and nerdctl.

Usage

Importing the module

COMING SOON: We are currently working on publishing this module to PS Gallery to make it easier to import the module

Option 1

Manually import this module using:

Import-Module -Name <absolute-path>\containers-toolkit.psd1 -Force

Containers-Toolkit

Option 2

Clone containers-toolkit into one of the folder locations in the $env:PSModulePath environment variable.

To get a possible module path:

$env:PSModulePath
cd <module path>
git clone https://github.com/microsoft/containers-toolkit.git
Import-Module -Name containers-toolkit -Force

Option 3

Clone containers-toolkit to a folder location of choice and add the new module location to the Windows PowerShell module path

cd <module path>
git clone https://github.com/microsoft/containers-toolkit.git


$env:PSModulePath = "$env:PSModulePath;<path-to-module-directory>"

Import-Module -Name containers-toolkit -Force

Get the module details

Get-Help containers-toolkit
Get-Module -Name containers-toolkit

Command reference

  1. List of all available commands can be found in the Command reference section
  2. Detailed command reference for each cmdlet can be found in the About section

List of available commands

Get-Command -Module containers-toolkit

Examples

  1. Get help for Install-Containerd command

    Get-Help Install-Containerd
  2. List container tools (Containerd, BuildKit, and nerdctl) install status

    Show-ContainerTools
  3. Installs Containerd version 1.7.7 at 'C:\Test\Path\containerd' and adds 'C:\Test\Path\containerd' in the environment path.

    Install-Containerd -Version "1.7.7" -InstallPath 'C:\Test\Path\Containerd'

Important Notes

  1. Requires elevated PowerShell to run some commands.

  2. To use these tools (Containerd, BuildKit, and nerdctl), ensure that Containers and HyperV Windows features are enabled.

To get the features to enable, use:

Get-WindowsOptionalFeature -Online | `
    Where-Object { $_.FeatureName -like 'containers' -or $_.FeatureName -match "Microsoft-Hyper-V(-All)?$" } | `
    Select-Object FeatureName, Possible, State, RestartNeeded

To enable a feature:

Enable-WindowsOptionalFeature -Online -FeatureName '<Feature-Name-Here>' -All -NoRestart
  1. Requires PowerShell modules HNS and ThreadJob

FAQs

  1. Error when running Import-Module

TODO

  • Pipeline configuration
  • Publish module to PSGallery
  • Fix Code analysis warnings
  • Dev install: (Hacks) Add functions in Containerd and BuildKit to build from source files. (Is this really necessary? May be an overkill)
  • Publish to Microsoft Learn: MicrosoftDocs / Virtualization-Documentation
  • Rename this module to containerstoolkit: The current name for this module might cause confusion with repository named windows-containers-tools
  • Update README.md (Documentation)
  • Update containers-toolkit/containers-toolkit.Format.ps1xml (Documentation)
  • Update Containers-Toolkit/Containers-ToolkitlsForWindows.help.txt (Documentation)
  • Use Containers-Toolkit
  • Add Pester test
  • Replace GitHub username in URL: https://github.com/...
  • Rootless installation: Not needed for Windows

Contribution

Related Projects

This project builds on work done by others to create a PowerShell module.

Container tools repositories

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •