构建过程因“权限被拒绝”而终止。
拉并捕获marcelstoer / nodemcu-build的最新图像。并运行构建过程。它在Powershell下运行。
PS> $inv=${Get-Location}.Path
PS> docker run --rm -it -v ${inv}:/opt/nodemcu-firmware marcelstoer/nodemcu-build build
esp-open-sdk/
esp-open-sdk/xtensa-lx106-elf/
esp-open-sdk/xtensa-lx106-elf/libexec
<snip>
esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/crti.o
esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/crtn.o
sed: cannot remove app/include/sedr4uC4x: Permission denied
PS>
我猜想Window和Docker之间的权限问题。检查对Ubuntu映像的权限。
PS> docker run --rm -it -v ${inv}:/opt/nodemcu-firmware ubuntu
root@3c6ec540bf04:/# ls /opt/nodemcu-firmware/
CONTRIBUTING.md LICENSE Makefile README.md app bin docs ld local lua_examples lua_modules mkdocs.yml rtd-requirements.txt sdk-overrides tools
root@3c6ec540bf04:/# cd !$
cd /opt/nodemcu-firmware/
root@3c6ec540bf04:/opt/nodemcu-firmware# touch aa
root@3c6ec540bf04:/opt/nodemcu-firmware# ls -la aa
---------- 1 root root 0 Sep 17 05:29 aa
root@3c6ec540bf04:/opt/nodemcu-firmware# rm aa
root@3c6ec540bf04:/opt/nodemcu-firmware# ls -la aa
ls: cannot access 'aa': No such file or directory
root@3c6ec540bf04:/opt/nodemcu-firmware#`
看起来不错。 nodemcu映像有什么问题?
Windows 10 Pro 10.0.17134 N/A Build 17134
Docker version 18.06.1-ce, build e68fc7a
nodemcu-build image
latest: Pulling from marcelstoer/nodemcu-build
Digest: sha256:5ae64c6593f8e40d03be219430f1ce3b2bca8c30421c53f91b3410e94cc9f57d
Status: Image is up to date for marcelstoer/nodemcu-build:latest
PS > docker run --rm -it -v ${inv}:/opt2/nodemcu-firmware marcelstoer/nodemcu-build bash
root@d29c33feb584:/opt/nodemcu-firmware# cd .. && cp -rfp /opt2/nodemcu-firmware . && chmod a+x nodemcu-firmware/tools/esptool.py
root@d29c33feb584:/opt# cd nodemcu-firmware/ && build
root@d29c33feb584:/opt/nodemcu-firmware# cp -rfp bin /opt2/nodemcu-firmware/
root@d29c33feb584:/opt/nodemcu-firmware# exit
PS > ls bin
-ar--- 2018/09/19 0:24 119 .gitignore
-a---- 2018/09/19 0:24 29120 0x00000.bin
-a---- 2018/09/19 0:24 393216 0x10000.bin
-a---- 2018/09/19 0:24 458752 nodemcu_float_master_20180918-1523.bin
-a---- 2018/09/19 0:24 1181814 nodemcu_float_master_20180918-1523.map
构建完成。我想这是Windows上Docker上的权限处理问题。