cancel
Showing results for 
Search instead for 
Did you mean: 
Nick6
Mission Specialist
Mission Specialist
  • 801 Views

DO188 Chapter 4 lab error

Jump to solution

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.

Nick6_0-1685874638728.png

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.

Labels (1)
2 Solutions

Accepted Solutions
tnishiok
Flight Engineer
Flight Engineer
  • 779 Views

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?

[student@workstation custom-lab]$ podman run --name=custom-lab -it --entrypoint bash -p 8080:8080 -p 8443:8443 podman-qr-app

bash-4.4$ ls -la /opt/app-root/src/.npm/_cacache/tmp/
total 0
drwxr-xr-x. 2 default root 6 Jun 4 20:16 .
drwxr-xr-x. 5 default root 51 Jun 4 20:16 ..
 
bash-4.4$ whoami
student
 
bash-4.4$ npm start

> custom-images-lab@1.0.0 start
> node index.js

TLS Server running on port 8443
Server running on port 8080
 

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.

View solution in original post

Nick6
Mission Specialist
Mission Specialist
  • 738 Views

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.

View solution in original post

5 Replies
Tess
Flight Engineer
Flight Engineer
  • 784 Views

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. 

tnishiok
Flight Engineer
Flight Engineer
  • 780 Views

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?

[student@workstation custom-lab]$ podman run --name=custom-lab -it --entrypoint bash -p 8080:8080 -p 8443:8443 podman-qr-app

bash-4.4$ ls -la /opt/app-root/src/.npm/_cacache/tmp/
total 0
drwxr-xr-x. 2 default root 6 Jun 4 20:16 .
drwxr-xr-x. 5 default root 51 Jun 4 20:16 ..
 
bash-4.4$ whoami
student
 
bash-4.4$ npm start

> custom-images-lab@1.0.0 start
> node index.js

TLS Server running on port 8443
Server running on port 8080
 

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.

Tess
Flight Engineer
Flight Engineer
  • 752 Views

> "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 .

0 Kudos
Nick6
Mission Specialist
Mission Specialist
  • 739 Views

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.

Nick6
Mission Specialist
Mission Specialist
  • 772 Views

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.

Join the discussion
You must log in to join this conversation.