Skip to content

PowerShell Core cannot start a PS Job in .NET Core SDK Alpine image #1922

@ghost

Description

Steps to reproduce the issue

docker run -it --rm mcr.microsoft.com/dotnet/core/sdk:3.1.202-alpine3.11 pwsh -Command "& { Start-Job { 'test' } | Receive-Job -Wait }"

Expected behavior

test

Actual behavior

OpenError: [localhost] An error occurred while starting the background process. Error reported: No such file or directory.

Additional information

This issue happens only in the SDK image - if I install PowerShell by following steps on Installing PowerShell on Linux, then this problem doesn't seem to occur.

For a comparison, this works as expected:

docker run -it --rm mcr.microsoft.com/powershell:lts-alpine-3.10 pwsh -Command "& { Start-Job { 'test' } | Receive-Job -Wait }"

The extra problem with the SDK image is that I can't run dotnet tool update or dotnet tool uninstall to replace the tool with a working version of powershell core because both fail with error:

dotnet tool uninstall --tool-path /usr/share/powershell powershell.linux.alpine
Failed to uninstall tool package 'powershell.linux.alpine': Cross-device link

Output of docker version

Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:23:10 2020
 OS/Arch:           windows/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:16 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info

Client:
 Debug Mode: false
 Plugins:
  app: Docker Application (Docker Inc., v0.8.0)
  buildx: Build with BuildKit (Docker Inc., v0.3.1-tp-docker)
  mutagen: Synchronize files with Docker Desktop (Docker Inc., testing)

Server:
 Containers: 33
  Running: 0
  Paused: 0
  Stopped: 33
 Images: 105
 Server Version: 19.03.8
 Storage Driver: overlay2
  Backing Filesystem: <unknown>
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.76-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.945GiB
 Name: docker-desktop
 ID: GLOX:A5WL:ESZ4:LPSH:C7UZ:GQRP:TIPV:WXZO:6KKB:I7Y3:MDOF:INPX
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 40
  Goroutines: 52
  System Time: 2020-05-15T14:58:35.816208472Z
  EventsListeners: 3
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

Metadata

Metadata

Labels

area-dockerfilesConcerns the official .NET Dockerfiles or Dockerfile templates

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions