尝试将映像部署到Cloud Run时出现以下“权限被拒绝”错误:
应用程序无法启动:无法创建初始化进程: 无法加载/ usr / local / bin / dumb-init:权限被拒绝
Dockerfile包含以下指令:
....
....
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init
....
....
ENTRYPOINT ["dumb-init", "--"]
该映像在本地成功运行,但由于上述错误而无法部署到Cloud run。
答案 0 :(得分:0)
直接下载二进制文件 由于dumb-init是作为静态链接的二进制文件发布的,因此通常可以将其放入图像中。这是在Dockerfile中执行此操作的示例:
运行wget -O / usr / local / bin / dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64
运行chmod + x / usr / local / bin / dumb-init
https://github.com/Yelp/dumb-init#option-4-downloading-the-binary-directly