Hi,
After building the image near the end of Chapter 4 "Lab: Custom Container Images" of course DO188 and then running the container, the following error results.
I have tried building the image from the solution and I get the same error.
Is there something I'm missing or is it a bug?
Thanks for your help.
I recently completed the DO188 course and I can confirm that application could run. Why not looking into the container by replacing the entrypoint with bash so that you can check files under the "/opt/app-root/src/.npm/_cacache/tmp/" directory which looks suspicious as @Tess suggested?
It's empty in my container and the app can start w/o error. BTW DO188 has two versions v4.10 and v4.12 but I followed the instructions of v4.12.
Thank you for your ideas on a solution. I have found it to work but I think the more correct solution is to follow the intructions in the error by applying this line in the Containerfile -
sudo chown -R 998:995 "/opt/app-root/src/.npm"
Obviously one would adapt this in the Containerfile by adding the RUN, dropping the sudo and replacing the student user/group.
This worked for me.
Thanks again.
The error messages show a clear explanation of what's going wrong: the files for the NodeJS application are owned by "root" as opposed by the user that's running the app.
Make sure to match up the "USER" directive with the file ownerships of the application files.
I recently completed the DO188 course and I can confirm that application could run. Why not looking into the container by replacing the entrypoint with bash so that you can check files under the "/opt/app-root/src/.npm/_cacache/tmp/" directory which looks suspicious as @Tess suggested?
It's empty in my container and the app can start w/o error. BTW DO188 has two versions v4.10 and v4.12 but I followed the instructions of v4.12.
> "Why not looking into the container by replacing the entrypoint with bash so
> that you can check files"
This is of course the best advice possible!
Learn how to troubleshoot, instead of only following the instructions the training gives to you. Excellent suggestion @tnishiok .
Thank you for your ideas on a solution. I have found it to work but I think the more correct solution is to follow the intructions in the error by applying this line in the Containerfile -
sudo chown -R 998:995 "/opt/app-root/src/.npm"
Obviously one would adapt this in the Containerfile by adding the RUN, dropping the sudo and replacing the student user/group.
This worked for me.
Thanks again.
Thanks for the suggestions so far. I will try them in due course.
It is version 4.12.
It still makes me wonder why the solution doesn't work though.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.