【问题标题】:not able to create a file in openshift gives Permission denied无法在 openshift 中创建文件导致权限被拒绝
【发布时间】:2020-03-18 12:46:31
【问题描述】:

我有以下 dockerfile 并使用我创建了用于我的 openshift 部署的 docker 映像,但 pod 的日志显示错误

/bin/sh: can't create /etc/nginx/conf.d/default.conf: Permission denied

这是我的 Dockerfile

FROM abc/abc-ui-base:latest AS build

FROM nginx:stable-alpine

RUN set -ex && apk --update add ruby
COPY --from=build /root/build/nginx.docker.conf /etc/nginx/conf.d/fs.template
COPY --from=build /root/dist /public

RUN chmod go+w /var/cache/nginx
RUN chmod -R 777 /etc/nginx

CMD erb /etc/nginx/conf.d/fs.template > /etc/nginx/conf.d/default.conf; cat /etc/nginx/conf.d/default.conf; nginx -g 'daemon off;'

【问题讨论】:

    标签: docker openshift


    【解决方案1】:

    我在 docker 文件中添加了以下行,问题已解决。所以 erb 命令起作用了

    RUN chmod 777 /etc/nginx/conf.d/default.conf
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多