我猜您正在尝试在非arm64v8平台上构建docker映像。我会以为其余的答案。
提供的解决方案将特定于Ubuntu发行版(主机),但我猜它应该与其他Linux发行版上的类似。
解决方案1 [在Ubuntu 18.04上工作]
从https://github.com/docker/for-
linux/issues/56,我们可以看到Debian(以及Ubuntu?)软件包中当前存在bug。
sudo apt-get install qemu-user-staticgit clone https://github.com/computermouth/qemu-static-conf.gitsudo mkdir -p /lib/binfmt.dsudo cp qemu-static-conf uint16_t e_type; uint16_t e_machine; uint32_t e_version; ElfN_Addr e_entry; ElfN_Off e_phoff; ElfN_Off e_shoff; uint32_t e_flags; uint16_t e_ehsize; uint16_t e_phentsize; uint16_t e_phnum; uint16_t e_shentsize; uint16_t e_shnum; uint16_t e_shstrndx;} ElfN_Ehdr;
请注意,
binfmt配置由docker共享,因此它将尝试获取
/usr/bin/qemu-arm-static容器内部。这就是您仍然需要复制/ usr
/ bin / qemu-arm-static的原因。



