Skip to content

docker build hangs indefinitely exporting layers. #213

@mwfriedm

Description

@mwfriedm

Describe the bug
This is a duplicate of microsoft/hcsshim#696, but I was asked to open a new issue here.

To Reproduce
Dockerfile:

FROM mcr.microsoft.com/windows/servercore:ltsc2019
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Invoke-WebRequest -Uri "https://github.com/msys2/msys2-installer/releases/download/2021-07-25/msys2-base-x86_64-20210725.sfx.exe" -OutFile msys2.exe; \
  .\msys2.exe -y -oC:\ ; \
  Remove-Item msys2.exe; \
  C:\msys64\usr\bin\bash.exe -lc ' '; \
  C:\msys64\usr\bin\bash.exe -lc 'pacman --noconfirm -Syuu'; \
  C:\msys64\usr\bin\bash.exe -lc 'pacman --noconfirm -Syuu gcc git make zip'; \
  C:\msys64\usr\bin\bash.exe -lc 'pacman -Scc --noconfirm'; \
  Get-Date

docker build

... output ...
Database directory: /var/lib/pacman/
:: Do you want to remove unused repositories? [Y/n]
removing unused sync repositories...
Monday, March 28, 2022 10:02:58 AM

At this point, the RUN command has completed successfully. Docker engine takes a few minutes to write out the file system layers, and the child process (i.e. docker-windows-write-layer) exits.

dockerd.exe is now hung, and a stale hcsNNNNNNNNNN folder is left in C:\ProgramData\Docker\tmp (or wherever you have the dockerd data directory configured).

Expected behavior
The docker build command completes successfully.

Configuration:

  • Edition: Windows 10 Enterprise Version 1909 (OS Build 18363.2158)
  • Base Image being used: Windows Server Core ltsc 2019
  • Container engine: docker
  • Container Engine version 20.10.11

Additional context

docker.exe info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)
  compose: Docker Compose (Docker Inc., v2.0.0-rc.2)
  scan: Docker Scan (Docker Inc., v0.8.0)

Server:
 Server Version: 20.10.11
 Storage Driver: windowsfilter
  Windows:
 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 18363 (18362.1.amd64fre.19h1_release.190318-1202)
 Operating System: Windows 10 Enterprise Version 1909 (OS Build 18363.2158)
 OSType: windows
 Architecture: x86_64

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions