Skip to content

Consider setting the SHELL to pwsh in Docker images #394

Closed
@MichaelSimons

Description

@MichaelSimons

Steps to reproduce

Build the following Dockerfile

FROM microsoft/powershell:6.0.1-nanoserver-1709
RUN Get-ChildItem

Expected behavior

docker build would succeed. I was expecting the SHELL would be set to pwsh in the powershell images.

SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

This makes it easy to use the PS 'out of the box' in Dockerfiles based on microsoft/powershell.

Actual behavior

docker build fails with the following error

Sending build context to Docker daemon  135.7kB
Step 1/2 : FROM microsoft/powershell:6.0.1-nanoserver-1709
 ---> 7dff9740d9d5
Step 2/2 : RUN Get-ChildItem
 ---> Running in f1c4985fd989
'Get-ChildItem' is not recognized as an internal or external command,
operable program or batch file.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions