AnD*_*123 18 docker dockerfile
有没有理由我需要在我的入口点脚本上使用chmod + x?它没有出现的Redis在其dockerfile(这样做https://github.com/docker-library/redis/blob/109323988b7663bceaf4a01c3353f8934dfc002e/2.8/Dockerfile)为他们的入口点脚本.
Dockerfile:
# Generic Docker Image for Running Node app from Git Repository
FROM node:0.10.33-slim
ENV NODE_ENV production
# Add script to pull Node app from Git and run the app
COPY docker-node-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 8080
CMD ["--help"]
Run Code Online (Sandbox Code Playgroud)
ISa*_*ych 13
redis不需要这样做,因为他们的脚本已经有exec标志:
~/redis/2.8$ ls -l docker-entrypoint.sh
-rwxrwxr-x 1 igor igor 109 Dec 3 23:52 docker-entrypoint.sh
Run Code Online (Sandbox Code Playgroud)
如果您将为docker-node-entrypoint.sh脚本执行此操作,则在Dockerfile中也不需要chmod.
这是可能的,因为默认情况下git core.fileMode选项为true,因此文件的可执行位受到尊重.
BMi*_*tch 12
Docker 将使用文件源的权限将文件复制到容器中。如果您在推送到代码存储库或构建主机的链中的某处剥离 Linux 可执行位,那么您需要重新添加这些执行权限。我见过这个问题最常由 Windows 用户报告,他们将代码下载到不支持 Linux 权限位的文件系统。希望我们能很快得到一个COPY --chmod
解决方案,消除对额外层的需求。
归档时间: |
|
查看次数: |
35664 次 |
最近记录: |