dockerfileでインストールするPythonのバージョンを3.6から3.9に上げたところ、newrelic-lambda-cliのインストールでエラーが出て、dockerイメージの作成が失敗するようになりました(3.6の時は成功していました)。調べましたがわからなかったので、教えていただけると嬉しいです。
変更前
dockerfile
1 pyenv install 3.6.1 2 pyenv global 3.6.1
↓
変更後
dockerfile
1 pyenv install 3.9.1 2 pyenv global 3.9.1
■エラーになっている箇所
RUN pip install newrelic-lambda-cli
■エラーの内容
=> ERROR [12/38] RUN pip install newrelic-lambda-cli 8.8s ------ > [12/38] RUN pip install newrelic-lambda-cli: #15 1.005 Collecting newrelic-lambda-cli #15 1.113 Downloading newrelic-lambda-cli-0.7.1.tar.gz (39 kB) #15 1.383 Installing build dependencies: started #15 5.523 Installing build dependencies: finished with status 'done' #15 5.529 Getting requirements to build wheel: started #15 5.771 Getting requirements to build wheel: finished with status 'done' #15 5.984 Installing backend dependencies: started #15 8.294 Installing backend dependencies: finished with status 'done' #15 8.301 Preparing metadata (pyproject.toml): started #15 8.586 Preparing metadata (pyproject.toml): finished with status 'error' #15 8.600 error: subprocess-exited-with-error #15 8.600 #15 8.600 × Preparing metadata (pyproject.toml) did not run successfully. #15 8.600 │ exit code: 1 #15 8.600 ╰─> [65 lines of output] #15 8.600 running dist_info #15 8.600 creating /tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info #15 8.600 writing /tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info/PKG-INFO #15 8.600 writing dependency_links to /tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info/dependency_links.txt #15 8.600 writing entry points to /tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info/entry_points.txt #15 8.600 writing requirements to /tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info/requires.txt #15 8.600 writing top-level names to /tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info/top_level.txt #15 8.600 writing manifest file '/tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info/SOURCES.txt' #15 8.600 reading manifest file '/tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info/SOURCES.txt' #15 8.600 reading manifest template 'MANIFEST.in' #15 8.600 adding license file 'LICENSE' #15 8.600 writing manifest file '/tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli.egg-info/SOURCES.txt' #15 8.600 creating '/tmp/pip-modern-metadata-q5zhcoc0/newrelic_lambda_cli-0.7.1.dist-info' #15 8.600 Traceback (most recent call last): #15 8.600 File "/.pyenv/versions/3.9.2/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module> #15 8.600 main() #15 8.600 File "/.pyenv/versions/3.9.2/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main #15 8.600 json_out['return_val'] = hook(**hook_input['kwargs']) #15 8.600 File "/.pyenv/versions/3.9.2/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel #15 8.600 return hook(metadata_directory, config_settings) #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel #15 8.600 self.run_setup() #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 281, in run_setup #15 8.600 super(_BuildMetaLegacyBackend, #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup #15 8.600 exec(compile(code, __file__, 'exec'), locals()) #15 8.600 File "setup.py", line 7, in <module> #15 8.600 setup( #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup #15 8.600 return distutils.core.setup(**attrs) #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 177, in setup #15 8.600 return run_commands(dist) #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 193, in run_commands #15 8.600 dist.run_commands() #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands #15 8.600 self.run_command(cmd) #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command #15 8.600 super().run_command(command) #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command #15 8.600 cmd_obj.run() #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/command/dist_info.py", line 42, in run #15 8.600 bdist_wheel = self.get_finalized_command('bdist_wheel') #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 303, in get_finalized_command #15 8.600 cmd_obj = self.distribution.get_command_obj(command, create) #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 859, in get_command_obj #15 8.600 klass = self.get_command_class(command) #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 954, in get_command_class #15 8.600 self.cmdclass[command] = cmdclass = ep.load() #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 194, in load #15 8.600 module = import_module(match.group('module')) #15 8.600 File "/.pyenv/versions/3.9.2/lib/python3.9/importlib/__init__.py", line 127, in import_module #15 8.600 return _bootstrap._gcd_import(name[level:], package, level) #15 8.600 File "<frozen importlib._bootstrap>", line 1030, in _gcd_import #15 8.600 File "<frozen importlib._bootstrap>", line 1007, in _find_and_load #15 8.600 File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked #15 8.600 File "<frozen importlib._bootstrap>", line 680, in _load_unlocked #15 8.600 File "<frozen importlib._bootstrap_external>", line 790, in exec_module #15 8.600 File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 26, in <module> #15 8.600 from .macosx_libfile import calculate_macosx_platform_tag #15 8.600 File "/tmp/pip-build-env-8kyij6qt/overlay/lib/python3.9/site-packages/wheel/macosx_libfile.py", line 41, in <module> #15 8.600 import ctypes #15 8.600 File "/.pyenv/versions/3.9.2/lib/python3.9/ctypes/__init__.py", line 8, in <module> #15 8.600 from _ctypes import Union, Structure, Array #15 8.600 ModuleNotFoundError: No module named '_ctypes' #15 8.600 [end of output] #15 8.600 #15 8.600 note: This error originates from a subprocess, and is likely not a problem with pip. #15 8.603 error: metadata-generation-failed #15 8.603 #15 8.603 × Encountered error while generating package metadata. #15 8.603 ╰─> See above for output. #15 8.603 #15 8.603 note: This is an issue with the package mentioned above, not pip. #15 8.603 hint: See above for details. ------ executor failed running [/bin/sh -c pip install newrelic-lambda-cli]: exit code: 1
■試してみたこと
awscliをインストールするコマンドを先に持ってきて、インストールするバージョンをV2に変更しました。
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" RUN unzip awscliv2.zip RUN ./aws/install
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/07/06 08:20 編集