dotnet / dotnet/dotnet-docker

Cannot start nested PWSH due to executable permission problems

Open
#7,205 1 comment 0 reactions 1 assignee Claimed by @lbussell View on GitHub
area-dockerfiles
Dominant language
Dockerfile
Stars
4.9k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
26

Description

### 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`

```console

```

### Output of `docker info`

```console

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.