got "Error processing tar file(exit status 1): archive/tar: invalid tar header" when docker load
Closed this issue · 1 comments
DNXie commented
When I run docker load<contractfuzzer.tar
to load the image, I got this error:
Error processing tar file(exit status 1): archive/tar: invalid tar header
.
DNXie commented
The problem is solved. (Reference: https://stackoverflow.com/questions/40622162/docker-load-and-save-archive-tar-invalid-tar-header)
Apparently, docker save [image] > file.tar
followed by docker load < file.tar
will not work if the save and load are executed on a different OS.
That is why the loading operation works on MacOS
but not on Linux
.
Better option:
docker save [image] -o file.tar
and docker load -i file.tar
I solved this problem by doing the following steps:
- Load the
.tar
file onMacOS
bydocker load < file.tar
. - Re-save the image to
.tar
file using the correct command (docker save [image] -o file.tar
). - Copy the new
.tar
file to whatever other OS you have (e.g.Linux
). - Load the new
.tar
file using the correct command (docker load -i file.tar
).