首先需要确定思路的是生成镜像时,程序发现 /usr/bin/entrypoint.sh 文件没有可执行权限,才会报这个错误。围绕这个问题,需要修改 Dockfile文件,简单举个例子:
RUN set -ex && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache \
--virtual .build-deps \
build-base \
curl \
openssl-dev \
tar && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache \
--virtual .build-deps \
build-base \
curl \
openssl-dev \
tar && \
语句应该加在RUN的后面,属于系统级别参数设置,修改如下:
RUN set -ex && \
chmod a+x /usr/bin/entrypoint.sh && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache \
--virtual .build-deps \
build-base \
curl \
openssl-dev \
tar && \
chmod a+x /usr/bin/entrypoint.sh && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache \
--virtual .build-deps \
build-base \
curl \
openssl-dev \
tar && \
原创文章,转载请注明: 转载自混沌
本文链接地址: 编译Dockfile时提示:exec: “/usr/bin/entrypoint.sh”: permission denied: unknown 的解决方法