Photo by Robert Katzki on Unsplash
Due to an Angular migration, the following command requires to run on a non root user due to post-install custom script in our project:
RUN npm install
In order to do this we had to:
- create a user
RUN useradd -ms /bin/bash user
- change ownership of workdir
RUN chown user ../app
- copy files using the new user
COPY --chown=user src/myapp/myapp.csproj src/myapp/
- change user
USER user
Hope this helps !
Top comments (0)