4

I'm trying to build an image from CentOS 6.9. Using this Dockerfile:

FROM centos:6.9

RUN ls

But it keeps failing with exit code 139 with the following output:

$ docker build -t centos-6.9 .
[+] Building 1.1s (7/7) FINISHED
 => [internal] load build definition from Dockerfile                                                                                             0.0s 
 => => transferring dockerfile: 72B                                                                                                              0.0s 
 => [internal] load .dockerignore                                                                                                                0.0s 
 => => transferring context: 2B                                                                                                                  0.0s 
 => [internal] load metadata for docker.io/library/centos:6.9                                                                                    0.6s 
 => [internal] load build context                                                                                                                0.1s 
 => => transferring context: 72B                                                                                                                 0.0s 
 => CACHED [1/3] FROM docker.io/library/centos:6.9@sha256:6fff0a9edc920968351eb357c5b84016000fec6956e6d745f695e5a34f18ecd2                       0.0s 
 => [2/3] COPY . .                                                                                                                               0.0s 
 => ERROR [3/3] RUN ls                                                                                                                           0.3s 
------
 > [3/3] RUN ls:
------
executor failed running [/bin/sh -c ls]: exit code: 139

I'm running:

  • Windows 10 Enterprise Version 2004
  • Docker Desktop 3.0.0
Yohanna
  • 483
  • 1
  • 6
  • 14

1 Answers1

10

This appears to be an issue with WSL 2 with older base images, not docker or the image itself.

  1. Create %userprofile%\.wslconfig file.

  2. Add the following:

[wsl2]
kernelCommandLine = vsyscall=emulate
  1. Restart WSL. wsl --shutdown

  2. Restart Docker Desktop.

References:

  1. https://github.com/microsoft/WSL/issues/4694#issuecomment-556095344
  2. https://github.com/docker/for-win/issues/7284#issuecomment-646910923
  3. https://github.com/microsoft/WSL/issues/4694#issuecomment-558335829
Yohanna
  • 483
  • 1
  • 6
  • 14