我的Dockerfile文件有python3,我得到:
RUN repo init -u https://android.googlesource.com/platform/manifest
---> Running in f3adc38c2aac
/usr/bin/env: 'python': No such file or directory如果我安装了python,我会得到这样的错误:
Step 6/7 : RUN repo init -u https://android.googlesource.com/platform/manifest
---> Running in 9c03e1b95c0f
repo: warning: Python 2 is no longer supported; Please upgrade to Python 3.6+.
Traceback (most recent call last):
File "/home/project/aosp/.repo/repo/main.py", line 56, in <module>
from subcmds.version import Version
File "/home/project/aosp/.repo/repo/subcmds/__init__.py", line 38, in <module>
['%s' % name])
File "/home/project/aosp/.repo/repo/subcmds/upload.py", line 27, in <module>
from hooks import RepoHook
File "/home/project/aosp/.repo/repo/hooks.py", line 472
file=sys.stderr)
^
SyntaxError: invalid syntaxRepo的下载方式如下:
RUN mkdir -p /android_tools \
&& curl https://storage.googleapis.com/git-repo-downloads/repo > /android_tools/repo \
&& chmod a+x /android_tools/repo发布于 2020-12-25 04:02:24
https://storage.googleapis.com/git-repo-downloads/repo至少需要Python3.6。
要将python3与刚刚下载的repo一起使用,您需要修复shebang行:
sed -i '1s/python/python3/' /android_tools/repohttps://stackoverflow.com/questions/65442731
复制相似问题