Reputation: 51
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-
Any advice on how to fix this would be very helpful.
Upvotes: 3
Views: 6395
Reputation: 187
I got that error after upgrading docker on my Ubuntu machine and string the project. The simple rebuild fixed the issue:
@docker compose up -d --build && docker-compose start
Upvotes: 0
Reputation: 93
I also had this problem with docker pull and larger images. In my case, the cause for this error was broken/damaged RAM. After detecting with memtest and removing the faulty sticks, the pull worked again.
Upvotes: 0
Reputation: 21
I was also having this issue on Docker version 20.10.21
Upgraded to Docker version 24.0.5
and the issue no longer occurred.
Upvotes: 1
Reputation: 51
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:
sudo nano /lib/systemd/system/docker.service
Environment=MOBY_DISABLE_PIGZ=1
sudo systemctl daemon-reload
sudo systemctl restart docker
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.
Upvotes: 1