gongbell / ContractFuzzer

The Ethereum Smart Contract Fuzzer for Security Vulnerability Detection (ASE 2018)
229 stars 85 forks source link

got "Error processing tar file(exit status 1): archive/tar: invalid tar header" when docker load #5

Closed DNXie closed 4 years ago

DNXie commented 5 years ago

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 5 years ago

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:

  1. Load the .tar file on MacOS by docker load < file.tar.
  2. Re-save the image to .tar file using the correct command (docker save [image] -o file.tar).
  3. Copy the new .tar file to whatever other OS you have (e.g. Linux).
  4. Load the new .tar file using the correct command (docker load -i file.tar).