【发布时间】:2019-12-12 05:37:31
【问题描述】:
我们正在尝试在Windows 10 机器上构建Python-flask 映像,以下是 Dockerfile 的一部分命令。
RUN chmod +x /var/www/projectname/entrypoint.local.sh
我们在尝试使用 docker 文件构建映像时遇到错误
这是错误:
chmod : The term 'chmod' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:76
+ ... nce = 'Stop'; $ProgressPreference = 'SilentlyContinue'; chmod +x /var ...
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (chmod:String) [], ParentContain sErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException ERROR: Service 'controller_service' failed to build: The command 'powershell
-Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; chmod +x /var/www/projectname/entry point.local.sh' returned a non-zero code: 1
它正在考虑将Dockerfile 中的chmod 作为Windows 命令。
编辑1:
我正在尝试使用以下命令将图像构建为docker-compose 的一部分:
docker-compose up --build.
我在Terminal 在Pycharm 在Windows 中运行上述命令。
请提出任何解决此问题的方法。谢谢!
【问题讨论】:
标签: windows docker dockerfile sh chmod