Repository navigation
On Windows after npm install docker crashes #44867
Description
Description
The same dockerfile works on linux distribution.I'm not sure if this is a bug.Maybe I'm doing something wrong.
Switched to linux containers.
WSL is enabled/ Hyper-V and stuff too.
I don't even know what else needs to be configured to make it work on windows.
I will be very glad to receive any answer.
I would also like to clarify that this occurs regardless of the Dockerfile.
I ran it on Linux Mint/Kali and it worked there.
I don't mean subsystem linux from windows
Even when I try to connect to the container, it turns off instantly.
Error:

By text:
npm ERR! code EISDIR
npm ERR! syscall read
npm ERR! path /src/package.json
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, read
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-01-21T13_38_00_193Z-debug-0.log
The command '/bin/sh -c npm install' returned a non-zero code: 4294967295: failed to shutdown container: container 5757e24a01954dcf40e70b6df0d6a077bdeceb2dc00811b197b852444e59e6ed encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110): subsequent terminate failed container 5757e24a01954dcf40e70b6df0d6a077bdeceb2dc00811b197b852444e59e6ed encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110)
Reproduce
docker build .
Expected behavior
No response
docker version
Client:
Cloud integration: v1.0.29
Version: 20.10.22
API version: 1.41
Go version: go1.18.9
Git commit: 3a2c30b
Built: Thu Dec 15 22:36:18 2022
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.16.2 (95914)
Engine:
Version: 20.10.22
API version: 1.41 (minimum version 1.24)
Go version: go1.18.9
Git commit: 42c8b31
Built: Thu Dec 15 22:31:10 2022
OS/Arch: windows/amd64
Experimental: truedocker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.10.0)
compose: Docker Compose (Docker Inc., v2.15.1)
dev: Docker Dev Environments (Docker Inc., v0.0.5)
extension: Manages Docker extensions (Docker Inc., v0.2.17)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.23.0)
Server:
Containers: 9
Running: 0
Paused: 0
Stopped: 9
Images: 8
Server Version: 20.10.22
Storage Driver: windowsfilter (windows) lcow (linux)
Windows:
LCOW:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics internal l2bridge l2tunnel nat null overlay private transparent
Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 19045 (19041.1.amd64fre.vb_release.191206-1406)
Operating System: Windows 10 Pro Version 2009 (OS Build 19045.2486)
OSType: windows
Architecture: x86_64
CPUs: 6
Total Memory: 15.88GiB
Name: DESKTOP-ND2RD7D
ID: GUSS:T6U7:ABMM:LHUU:5DFT:5FC7:ZFBE:V4HR:CQOM:FU2W:REYA:47KX
Docker Root Dir: C:\ProgramData\Docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community EngineAdditional Info
Docker Desktop Settings / Dockerfile



Activity
thaJeztah commentedon Jan 21, 2023
It looks like you have configured Docker Desktop to run Windows containers (see https://docs.docker.com/desktop/faqs/windowsfaqs/#how-do-i-switch-between-windows-and-linux-containers), but the Dockerfile uses a Linux base image (
node:18-alpineis based on Alpine Linux). It's not possible to run Linux containers on a Windows daemon.I don't think there's currently an official
nodeimage for Windows containers; there is a feature request here; nodejs/docker-node#695, and there was a pull request to implement it, but it still required some work and was closed (see nodejs/docker-node#362) - perhaps contributions are accepted for it (if someone's interested to work on it).So, this is "expected" currently (although the error message could be clearer; perhaps we should fail early in this case instead of only producing a warning (also related: #44181). For this case, I'd recommend switching Docker Desktop to use Linux containers (unless there's a specific requirement to use a Windows container for this, but that would require constructing a Dockerfile that installs node on a Windows base image).
I'm closing this ticket for now, because of the above, but feel free to continue the conversation.
SoulNaturalist commentedon Jan 21, 2023
Everything working, @thaJeztah thanks.