I am getting an error when trying to pull docker images on my Ubuntu machine. Below is an example of when I get the error. -
$ sudo docker pull postgres:14
14: Pulling from library/postgres
3f9582a2cbe7: Extracting 31.41MB/31.41MB
0d9d08fc1a1a: Download complete
ecae4ccb4d1b: Download complete
e75693e0d7a5: Download complete
1b6d5aead1a8: Download complete
f2aa67d9a6b2: Download complete
7a3ec0371e36: Download complete
704d9d1b662d: Download complete
54524e056363: Download complete
25bf4c84ca22: Download complete
40b6f9f7a0cb: Download complete
78ab4b71d139: Download complete
abd467968b89: Download complete
failed to register layer: Error processing tar file(exit status 1): archive/tar: invalid tar header
Additional information -
$ docker --version
Docker version 23.0.1, build a5ee5b1
Things I tried to fix this issue and none of them helped-
- Remove all docker images and restart docker service
- Completely uninstall and reinstall docker
- Tried pulling a different image. I was able to pull ubuntu:latest successfully. But I get the error when I tried to pull pcl image dlopezmadrid/pcl-docker:latest
Any advice on how to fix this would be very helpful.
So I was able to find a workaround for this issue after a lot of online digging. The solution is to disable parallel decompression for docker images on the host. Here's how you can do it:
After restarting the Docker daemon, parallel decompression should be disabled for Docker images on the host.
Note that this method modifies the Docker service directly, so any changes made to the systemd unit file will persist across system reboots.
Also, the downside to this workaround is that it'll take longer for you to pull images.