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.