rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2怎么解决

今天在打包然后运行docker镜像的时候遇到了这个问题

➜  docker-demo docker run javaweb:1.0 -d
rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
 Trace/breakpoint trap

注意观察,这个库函数里面有x86-64字样,指的是支持64位运算的X86架构的CPU,这种CPU一般由Intel和AMD家生产的芯片。

而如果恰好你的电脑是搭载Apple Chip例如M1/M2/M3的MacBook,那么系统里是没有这个函数库的,就会报错。

解决办法是在Docker引入Base操作系统的时候,加上--platform=linux/amd64指定AMD64格式,然后重新打镜像。

FROM --platform=linux/amd64 ubuntu:16.04

Reference:
https://stackoverflow.com/questions/71040681/qemu-x86-64-could-not-open-lib64-ld-linux-x86-64-so-2-no-such-file-or-direc

stellaechen@STELLAECHEN-MC1 Python-2.7.13 % make ./python.exe -E -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi running build running build_ext building '_Qt' extension gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/stellaechen/download/Python-2.7.13/Mac/Include -I. -IInclude -I./Include -I/usr/local/include -I/Users/stellaechen/download/Python-2.7.13/Include -I/Users/stellaechen/download/Python-2.7.13 -c /Users/stellaechen/download/Python-2.7.13/Mac/Modules/qt/_Qtmodule.c -o build/temp.macosx-15.4-arm64-2.7/Users/stellaechen/download/Python-2.7.13/Mac/Modules/qt/_Qtmodule.o -Wno-deprecated-declarations error: unable to open output file 'build/temp.macosx-15.4-arm64-2.7/Users/stellaechen/download/Python-2.7.13/Mac/Modules/qt/_Qtmodule.o': 'Operation not permitted' 1 error generated. building '_tkinter' extension gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DWITH_APPINIT=1 -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -I/System/Library/Frameworks/Tk.framework/Headers -I/System/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders -I/usr/X11R6/include -I/Users/stellaechen/download/Python-2.7.13/Mac/Include -I. -IInclude -I./Include -I/usr/local/include -I/Users/stellaechen/download/Python-2.7.13/Include -I/Users/stellaechen/download/Python-2.7.13 -c /Users/stellaechen/download/Python-2.7.13/Modules/_tkinter.c -o build/temp.macosx-15.4-arm64-2.7/Users/stellaechen/download/Python-2.7.13/Modules/_tkinter.o -framework Tk clang: warning: -framework Tk: 'linker' input unused [-Wunused-command-line-argument] In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_tkinter.c:71: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/tk.h:86:11: fatal error: 'X11/Xlib.h' file not found 86 | # include <X11/Xlib.h> | ^~~~~~~~~~~~ 1 error generated. building '_ctypes' extension gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I_ctypes/darwin -I/Users/stellaechen/download/Python-2.7.13/Mac/Include -I/Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include -I/Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/powerpc -I. -IInclude -I./Include -I/usr/local/include -I/Users/stellaechen/download/Python-2.7.13/Include -I/Users/stellaechen/download/Python-2.7.13 -c /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c -o build/temp.macosx-15.4-arm64-2.7/Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.o -DMACOSX In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:113: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:65:3: error: "Unsupported MacOS X CPU type" 65 | # error "Unsupported MacOS X CPU type" | ^ In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:113: In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:73: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffitarget.h:12:2: error: "Unsupported CPU type" 12 | #error "Unsupported CPU type" | ^ In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:113: In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:74: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/fficonfig.h:51:2: error: "Unknown CPU type" 51 | #error "Unknown CPU type" | ^ In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:113: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:171:5: error: unknown type name 'ffi_abi' 171 | ffi_abi abi; | ^ /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:193:2: error: unknown type name 'ffi_sarg' 193 | ffi_sarg sint; | ^ /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:194:2: error: unknown type name 'ffi_arg' 194 | ffi_arg uint; | ^ /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:307:11: error: unknown type name 'ffi_abi' 307 | ffi_abi abi, | ^ In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:129: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/ctypes.h:99:5: error: unknown type name 'ffi_closure' 99 | ffi_closure *pcl_write; /* the C callable, writeable */ | ^ 8 errors generated. Python build finished, but the necessary bits to build these modules were not found: _bsddb _curses _curses_panel _sqlite3 _ssl bsddb185 bz2 dbm dl gdbm imageop linuxaudiodev nis ossaudiodev readline spwd sunaudiodev zlib To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _ctypes _Qt _tkinter running build_scripts stellaechen@STELLAECHEN-MC1 Python-2.7.13 % make install /usr/bin/install -c python.exe /usr/local/bin/python2.7 install: /usr/local/bin/INS@20xsco: Permission denied make: *** [altbininstall] Error 71 stellaechen@STELLAECHEN-MC1 Python-2.7.13 %
07-05
ERROR in ./src/views/Layout/index.vue?vue&type=style&index=0&id=5d5a9732&scoped=true&lang=scss (./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/views/Layout/index.vue?vue&type=style&index=0&id=5d5a9732&scoped=true&lang=scss) Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (127) For more information on which environments are supported please see: https://github.com/sass/node-sass/releases/tag/v9.0.0 at module.exports (/Users/xiaol/Desktop/2024034314-作品主文件夹/2024034314-02素材与源码/code/vue/monkey/monkey/node_modules/node-sass/lib/binding.js:13:13) at Object.<anonymous> (/Users/xiaol/Desktop/2024034314-作品主文件夹/2024034314-02素材与源码/code/vue/monkey/monkey/node_modules/node-sass/lib/index.js:13:35) at Module._compile (node:internal/modules/cjs/loader:1554:14) at Object..js (node:internal/modules/cjs/loader:1706:10) at Module.load (node:internal/modules/cjs/loader:1289:32) at Function._load (node:internal/modules/cjs/loader:1108:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:220:24) at Module.require (node:internal/modules/cjs/loader:1311:12) at require (node:internal/modules/helpers:136:16) at getDefaultSassImplementation (/Users/xiaol/Desktop/2024034314-作品主文件夹/2024034314-02素材与源码/code/vue/monkey/monkey/node_modules/sass-loader/dist/utils.js:36:10) at getSassImplementation (/Users/xiaol/Desktop/2024034314-作品主文件夹/2024034314-02素材与源码/code/vue/monkey/monkey/node_modules/sass-loader/dist/utils.js:45:30) at Object.loader (/Users/xiaol/Desktop
04-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值