Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent docker build from failing if .npm folder is missing #924

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

Akash-Nayak
Copy link
Contributor

building image frontend
[+] Building 5.1s (9/10)                                                                           
 => [internal] load build definition from Dockerfile                                          0.1s
 => => transferring dockerfile: 868B                                                          0.0s
 => [internal] load .dockerignore                                                             0.0s
 => => transferring context: 56B                                                              0.0s
 => [internal] load metadata for registry.access.redhat.com/ubi8/nodejs-14:latest             0.0s
 => [internal] load build context                                                             0.2s
 => => transferring context: 2.91MB                                                           0.1s
 => [1/6] FROM registry.access.redhat.com/ubi8/nodejs-14                                      0.1s
 => [2/6] COPY . .                                                                            0.2s
 => [3/6] RUN npm install                                                                     2.1s
 => [4/6] RUN npm run build                                                                   1.5s
 => ERROR [5/6] RUN chown -R 1001:0 /opt/app-root/src/.npm                                    0.8s
------                                                                                             
 > [5/6] RUN chown -R 1001:0 /opt/app-root/src/.npm:
#9 0.708 chown: cannot access '/opt/app-root/src/.npm': No such file or directory
------
executor failed running [/bin/sh -c chown -R 1001:0 /opt/app-root/src/.npm]: exit code: 1

We added a fix in the PR #905 to resolve the permission denied issue on OpenShift cluster, but now the docker build was failing. So, I have added a fix to prevent the docker build from failing.

building image frontend
[+] Building 0.3s (12/12) FINISHED                                                                 
 => [internal] load build definition from Dockerfile                                          0.0s
 => => transferring dockerfile: 904B                                                          0.0s
 => [internal] load .dockerignore                                                             0.0s
 => => transferring context: 56B                                                              0.0s
 => [internal] load metadata for registry.access.redhat.com/ubi8/nodejs-14:latest             0.0s
 => [1/7] FROM registry.access.redhat.com/ubi8/nodejs-14                                      0.0s
 => [internal] load build context                                                             0.1s
 => => transferring context: 2.91MB                                                           0.1s
 => CACHED [2/7] COPY . .                                                                     0.0s
 => CACHED [3/7] RUN npm install                                                              0.0s
 => CACHED [4/7] RUN npm run build                                                            0.0s
 => CACHED [5/7] RUN mkdir -p /opt/app-root/src/.npm                                          0.0s
 => CACHED [6/7] RUN chown -R 1001:0 /opt/app-root/src/.npm                                   0.0s
 => CACHED [7/7] RUN chmod -R 775 /opt/app-root/src/.npm                                      0.0s
 => exporting to image                                                                        0.0s
 => => exporting layers                                                                       0.0s
 => => writing image sha256:7072fd0069d5d8c10405bbc769ec02708c28905ee9cccf63497f25ca0268fd76  0.0s
 => => naming to docker.io/library/frontend 

Signed-off-by: Akash Nayak akash19nayak@gmail.com

Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@ashokponkumar ashokponkumar enabled auto-merge (squash) December 7, 2022 17:50
@ashokponkumar ashokponkumar merged commit 9df7e75 into konveyor:main Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants