Running apt-get on debian:wheezy gives me a seg fault

Here’s my Dockerfile:

FROM debian:wheezy

RUN printf "deb http://archive.debian.org/debian/ wheezy main non-free contrib\ndeb-src http://archive.debian.org/debian/ wheezy main non-free contrib\ndeb http://archive.debian.org/debian-security/ wheezy/updates main non-free contrib\ndeb-src http://archive.debian.org/debian-security/ wheezy/updates main non-free contrib" > /etc/apt/sources.list \
    && apt-get -o Acquire::Check-Valid-Until=false update

Here’s the error I get when I try to build that Dockerfile:

Sending build context to Docker daemon  240.1kB
Step 1/2 : FROM debian:wheezy
 ---> 10fcec6d95c4
Step 2/2 : RUN printf "deb http://archive.debian.org/debian/ wheezy main non-free contrib\ndeb-src http://archive.debian.org/debian/ wheezy main non-free contrib\ndeb http://archive.debian.org/debian-security/ wheezy/updates main non-free contrib\ndeb-src http://archive.debian.org/debian-security/ wheezy/updates main non-free contrib" > /etc/apt/sources.list     && apt-get -o Acquire::Check-Valid-Until=false update
 ---> Running in 8267f67d6ce4
E: Method http has died unexpectedly!
E: Sub-process http received a segmentation fault.
The command '/bin/sh -c printf "deb http://archive.debian.org/debian/ wheezy main non-free contrib\ndeb-src http://archive.debian.org/debian/ wheezy main non-free contrib\ndeb http://archive.debian.org/debian-security/ wheezy/updates main non-free contrib\ndeb-src http://archive.debian.org/debian-security/ wheezy/updates main non-free contrib" > /etc/apt/sources.list     && apt-get -o Acquire::Check-Valid-Until=false update' returned a non-zero code: 100

Any ideas?

My available memory and disk space look fine.

It looks like debian:wheezy is not compatible with Docker Desktop for Windows. It is an old image, however, it works on Docker Desktop for Mac. If you try to run bash inside a debian wheezy container on Windows, that will fail too. I don’t know if it is a bug which can be fixed.

I know that you mention that you aren’t sure if this is an issue that can be fixed, however, is there any suggested workaround?

Since I don’t know what exactly caused it, I don’t know any other workaround than not using the old image or not using it on Windows. But I must admit, I don’t remember why I wrote about Windows. I guess I could reproduce the issue on Windows only. Did you get the error message using the same image and got the same error code as well?

Thank you. It actually appears that WSL seems to be the issue. I got it working by unchecking the “Use the WSL 2 based engine”.

If people have the issue in the future, I would suggest unchecking “Use the WSL 2 based engine” unless there is a reason that you absolutely must us it.