Skip to content

Cannot start nested PWSH due to executable permission problems #7205

@JustinGrote

Description

@JustinGrote

Describe the bug

Using 2-10.0

It appears there is some kind of shim used to redirect /usr/bin/pwsh to /usr/share/powershell/.store/powershell.linux.x64/7.6.1/powershell.linux.x64/7.6.1/tools/net10.0/any

It will start fine initially but if you need to start a nested powershell session, it will fail. This is because the new path gets added to PATH automatically and it tries to start from here instead of /usr/bin

Image

Workaround

Make the "nested" pwsh executable, then it will work fine.
sudo chmod +x '/usr/share/powershell/.store/powershell.linux.x64/7.6.1/powershell.linux.x64/7.6.1/tools/net10.0/any/pwsh'

Which .NET image(s) are you using?

mcr.microsoft.com/dotnet-sdk:2-10.0

Steps to reproduce

Start bash, then start pwsh, then try to start pwsh again

Other information

No response

Output of docker version

Output of docker info

Metadata

Metadata

Assignees

Labels

area-dockerfilesConcerns the official .NET Dockerfiles or Dockerfile templates

Type

No fields configured for Bug.

Projects

Status
Rollout

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions