简体   繁体   English

Docker 入口点权限被拒绝

[英]Docker entrypoint permission denied

I am currently trying to deal with a deployment to a kubernetes cluster.我目前正在尝试处理对 kubernetes 集群的部署。 The deployment keeps failing with the response部署不断失败并响应

 Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"/entrypoint.sh\": permission denied"

I have tried to change the permissions on the file which seem to succeed as if I ls -l I get -rwxr-xr-x as the permissions for the file.我试图更改似乎成功的文件的权限,就好像我 ls -l 我得到 -rwxr-xr-x 作为文件的权限一样。

I have tried placing the chmod command both in the dockerfile itself and prior to the image being built and uploaded but neither seems to make any difference.我曾尝试将 chmod 命令放在 dockerfile 本身以及在构建和上传图像之前,但似乎都没有任何区别。 Any ideas why I am still getting the error?任何想法为什么我仍然收到错误?

dockerfile below dockerfile 下面

FROM node:10.15.0
CMD []
ENV NODE_PATH /opt/node_modules

# Add kraken files
RUN mkdir -p /opt/kraken
ADD .  /opt/kraken/
# RUN chown -R node /opt/
WORKDIR /opt/kraken

RUN npm install && \
    npm run build && \
    npm prune --production

# Add the entrypoint
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
USER node
ENTRYPOINT ["/entrypoint.sh"]

This error is not about entrypoint error but command inside. 此错误与入口点错误无关,而与内部命令有关。 Always start scripts with "sh script.sh" either entrypoint or cmd. 始终使用入口点或cmd的“ sh script.sh”启动脚本。 In this case it would be: ENTRYPOINT ["sh", "entrypoint.sh"] 在这种情况下,它将是:ENTRYPOINT [“ sh”,“ entrypoint.sh”]

I created a github action with a Dockerfile and entrypoint.sh file.我使用 Dockerfile 和 entrypoint.sh 文件创建了一个 github 操作。 I run command 'chmod +x' in my computer and push to github repository.我在我的电脑上运行命令 'chmod +x' 并推送到 github 存储库。 I did not RUN 'chmod +x' in Dockerfile.我没有在 Dockerfile 中运行 'chmod +x'。 It works.有用。

托盘 docker exec -it /bin/sh

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 docker 入口点中的权限被拒绝 - permission denied in docker entrypoint Docker 入口点 initdb 权限被拒绝 - Docker entrypoint initdb PERMISSION DENIED 如何修复 Docker sh 入口点中的“权限被拒绝” - How to fix 'Permission denied' in Docker sh entrypoint Docker 入口点总是返回权限被拒绝 - Docker entrypoint always returns permission denied docker-compose docker-entrypoint-initdb.d 权限被拒绝 - docker-compose docker-entrypoint-initdb.d Permission denied 运行 bash 脚本的 docker 入口点获得“权限被拒绝” - docker entrypoint running bash script gets “permission denied” Amazon ECS - 在 Docker 入口点上使用 IAM 角色时权限被拒绝 - Amazon ECS - Permission denied when using IAM role on Docker entrypoint podman MongoDB docker-entrypoint.sh 权限被拒绝 - podman MongoDB docker-entrypoint.sh permission denied 错误:执行程序:“ / usr / local / bin / docker-entrypoint.sh”:统计信息/usr/local/bin/docker-entrypoint.sh:权限被拒绝 - error: exec: “/usr/local/bin/docker-entrypoint.sh”: stat /usr/local/bin/docker-entrypoint.sh: permission denied Docker 卡在“/usr/local/bin/docker-entrypoint.sh: Permission denied” - Docker stuck at “/usr/local/bin/docker-entrypoint.sh: Permission denied”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM