Docker加载并保存:"archive/tar:无效的tar标头" [英] Docker load and save: "archive/tar: invalid tar header"

查看:658
本文介绍了Docker加载并保存:"archive/tar:无效的tar标头"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Docker映像导入AWS Red Hat Linux(3.10.0-514.el7.x86_64)上的Docker中,并且出现错误;

I'm trying to import a Docker image into Docker on AWS Red Hat Linux (3.10.0-514.el7.x86_64) and am having problems with the error;

Error processing tar file(exit status 1): archive/tar: invalid tar header

同一图像在我的本地计算机上也可以在Windows上的Boot2Docker中正常工作.它很大(2.5 GB),但是我已经在Red Hat Linux实例上验证了校验和,并且与从源头获得的校验和相同.

This same image works fine on my local machine, and in Boot2Docker on Windows also. It's quite large (2.5 GB), but I've verified the checksum on the Red Hat Linux instance, and it's the same as from the source.

可能出什么问题了,或者我怎么解决?

What could be wrong, or how I can resolve it?

推荐答案

我想补充一点,该问题可能是由于Windows和Unix之间的STDOUT行为不同而引起的.因此,使用STDOUT进行保存的方式如下:

I wanted to add that the issue probably occurs because of the difference in behaviour of STDOUT between Windows and Unix. Therefore, using the STDOUT way of saving like:

docker save [image]>file.tar ,后跟 docker load<file.tar

将不起作用.始终使用:

will not work if the save and load are executed on a different OS. Always use:

docker保存[image] -o file.tar ,然后是 docker load -i file.tar

以防止出现这些问题.比较使用不同方法生成的TAR文件,您会发现它们的大小完全不同(我是303MB,而我是614MB).

to prevent these issues. Comparing the TAR files produced by the different methods, you will find that they have a completely different size (303MB against 614MB for me).

这篇关于Docker加载并保存:"archive/tar:无效的tar标头"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆