Skip to content

Commit bc22f16

Browse files
committed
Update Docker information
1 parent 0dd4558 commit bc22f16

File tree

1 file changed

+36
-45
lines changed

1 file changed

+36
-45
lines changed
Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,74 @@
11
---
22
description: How to use PowerShell that's preinstalled in a Docker image.
3-
ms.date: 08/01/2024
3+
ms.date: 03/11/2025
44
ms.devlang: powershell
55
ms.topic: conceptual
66
title: Using PowerShell in Docker
77
---
88

99
# Using PowerShell in Docker
1010

11-
We publish Docker images with PowerShell preinstalled. This article shows you how to get
12-
started using PowerShell in the Docker container.
11+
The .NET team publishes Docker images with PowerShell preinstalled. This article shows you how to
12+
get started using PowerShell in the Docker container.
1313

1414
## Finding available images
1515

16-
The released images require Docker 17.05 or newer. It's also expected that you are able to run
17-
Docker without `sudo` or local administrative rights. Please follow Docker's official
18-
[instructions][01] to install `docker` correctly.
16+
These images require Docker 17.05 or newer. It's also expected that you are able to run Docker
17+
without `sudo` or local administrative rights. Please follow Docker's official [instructions][02] to
18+
install `docker` correctly.
1919

20-
The release containers derive from the official distribution image, then install dependencies, and
21-
finally install the PowerShell package.
22-
23-
These containers live at [Microsoft Artifact Registry][05].
24-
25-
For more information about these Docker images, visit the [PowerShell-Docker][02] repository on
26-
GitHub.
20+
The .NET team publishes several Docker images designed for different development scenarios. The
21+
image for the .NET SDK contains PowerShell. For more information, see
22+
[Official .NET Docker images][01].
2723

2824
## Using PowerShell in a container
2925

3026
The following steps show the Docker commands required to download the image containing the latest
3127
available stable version of PowerShell and start an interactive PowerShell session.
3228

33-
```console
34-
docker run -it mcr.microsoft.com/powershell
35-
```
36-
37-
Use the following command to download and run the image containing the latest available preview
38-
version of PowerShell.
29+
The following command downloads the image containing the latest available stable versions of the
30+
.NET SDK and PowerShell.
3931

4032
```console
41-
docker run -it mcr.microsoft.com/powershell:preview
33+
docker pull mcr.microsoft.com/dotnet/sdk:9.0
4234
```
43-
> [!IMPORTANT]
44-
> The Docker images are built from official operating system (OS) images provide by the OS
45-
> distributor. These images may not have the latest security updates. Microsoft recommends that you
46-
> update the OS packages to the latest version to ensure the latest security updates are applied.
47-
48-
### Remove the image when no longer needed
4935

50-
The following command is used to delete the Docker image when you no longer need it.
36+
Use the following command to start an interactive PowerShell session in the container.
5137

5238
```console
53-
docker rmi mcr.microsoft.com/powershell
39+
docker run -it mcr.microsoft.com/dotnet/sdk:9.0 pwsh
5440
```
5541

56-
## Legal and Licensing
57-
58-
PowerShell is licensed under the [MIT license][03].
42+
To download and run the latest Long Term Support (LTS) version of PowerShell, change the image name
43+
to `mcr.microsoft.com/dotnet/sdk:8.0`. When you use these image tags, Docker downloads the
44+
appropriate image for your host operating system. If you want an image for a specific operating
45+
system, you can specify the operating system in the image tag. See the
46+
[Microsoft Artifact Registry][07] for a list of available tags.
5947

60-
### Windows Docker file and image licenses
48+
- For more information about tags, the [Supported tag policy][06]
49+
- For more information about supported operating systems, see the [Supported platforms policy][05]
6150

62-
By requesting and using the Container OS Image for Windows containers, you acknowledge, understand,
63-
and consent to the Supplemental License Terms available on Docker hub:
51+
## Support lifecycle
6452

65-
- [Window Server Core][06]
66-
- [Nano Server][04]
53+
Support for these images is governed by the [.NET support policy][03]. These images are provided for
54+
development and testing purposes only. If you need a production-ready image, you should build your
55+
own images. For more information about these Docker images, visit the [dotnet-docker][04] repository
56+
on GitHub.
6757

68-
### Telemetry
58+
## Telemetry
6959

7060
By default, PowerShell collects limited telemetry without personally identifiable information to
7161
help aid development of future versions of PowerShell. To opt-out of sending telemetry, create an
7262
environment variable called `POWERSHELL_TELEMETRY_OPTOUT` set to a value of `1` before starting
7363
PowerShell from the installed location. The telemetry we collect falls under the
74-
[Microsoft Privacy Statement][07].
64+
[Microsoft Privacy Statement][08].
7565

7666
<!-- link references -->
77-
[01]: https://docs.docker.com/engine/installation/
78-
[02]: https://github.com/PowerShell/PowerShell-Docker
79-
[03]: https://github.com/PowerShell/PowerShell/tree/master/LICENSE.txt
80-
[04]: https://mcr.microsoft.com/product/windows/nanoserver
81-
[05]: https://mcr.microsoft.com/product/powershell
82-
[06]: https://mcr.microsoft.com/product/windows/servercore
83-
[07]: https://privacy.microsoft.com/privacystatement/
67+
[01]: /dotnet/architecture/microservices/net-core-net-framework-containers/official-net-docker-images
68+
[02]: https://docs.docker.com/engine/installation/
69+
[03]: https://github.com/dotnet/core/blob/main/support.md
70+
[04]: https://github.com/dotnet/dotnet-docker
71+
[05]: https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-platforms.md
72+
[06]: https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-tags.md
73+
[07]: https://mcr.microsoft.com/en-us/artifact/mar/dotnet/sdk/about
74+
[08]: https://privacy.microsoft.com/privacystatement/

0 commit comments

Comments
 (0)