【发布时间】:2020-09-23 09:23:17
【问题描述】:
我试图在 heroku 上推送容器,但更改权限时出现此错误
FROM ubuntu:latest
ENV PORT=80
RUN apt-get update \
&& apt-get install -y curl zip unzip \
php7.4 php7.4-fpm \
nginx gettext-base sudo
COPY ./webapp /var/www/myapp
WORKDIR /var/www/myapp
COPY default.conf.template /etc/nginx/conf.d/default.conf.template
COPY nginx.conf /etc/nginx/nginx.conf
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
USER docker
RUN chown -R www-data:www-data /var/www
RUN chmod -R 755 /var/www
CMD /bin/bash -c "envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf" && nginx -g 'daemon off;'
我有这个错误
Step 10/12 : RUN chown -R www-data:www-data /var/www
---> Running in c5952535d0cc
chown: changing ownership of '/var/www/html/index.nginx-debian.html': Operation not permitted
chown: changing ownership of '/var/www/html': Operation not permitted
chown: changing ownership of '/var/www/myapp/index.php': Operation not permitted
chown: changing ownership of '/var/www/myapp/.gitignore': Operation not permitted
chown: changing ownership of '/var/www/myapp': Operation not permitted
chown: changing ownership of '/var/www': Operation not permitted
The command '/bin/sh -c chown -R www-data:www-data /var/www' returned a non-zero code: 1
! Error: docker build exited with Error: 1
提前谢谢你。
【问题讨论】:
标签: docker heroku dockerfile heroku-cli