Han
Han

Reputation: 426

can not modify /etc/nginx/conf.d/default.conf (read-only file system?)

I'm trying to deploy an Angular application onto Openshift (i.e an angular docker container on Openshift). However, I'm facing difficulty modifying the default.conf file within nginx in the container, which I think also caused the error at line 9.

Here's the error log on Openshift: enter image description here

Here's my dockerfile:

FROM node:latest as build
WORKDIR /usr/local/app
COPY ./ /usr/local/app/
RUN npm install
RUN npm run build

FROM nginxinc/nginx-unprivileged
COPY --from=build /usr/local/app/dist/ng-adminx /usr/share/nginx/html
COPY --from=build /usr/local/app/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

For context,

  1. I'm not familiar with how permissions work on Openshift.
  2. Also, this build works perfectly fine locally but fails on Openshift.

I think chmod or chown might be the solution. Would greatly appreciate any suggestion on how I should modify my dockerfile or navigate this! Thanks!

Upvotes: 2

Views: 5080

Answers (1)

yijie
yijie

Reputation: 21

You will need to use chmod to be able to modify the default.conf file.

For simplicity, you can use chmod 777 <filepathname>.

How does 777 come about? You can think of it as the permissions for read, write, execute for file owner, group and user respectively. 1 = allowed. 0 = not allowed.

So 7 in binary is 111.

file owner group other users
rwx rwx rwx
111 111 111

Upvotes: 1

Related Questions