cancel
Showing results for 
Search instead for 
Did you mean: 
Bianca79
Mission Specialist
Mission Specialist
  • 1,295 Views

Error running lab exercise Chapter 4 as stated in the solution

When I did the lab exercise of Chapter 4 I put the USER student before the RUN npm install --omit=dev instruction. The building resulted in the following error:

Error_lab4Error_lab4

Then I put the USER student instruction after the RUN instruction and could finish my lab.

However when I looked at the solution and the demo I see that USER student should be before the RUN command, but I can't get it working.

Can you explain why it is not working for me?

14 Replies
AlessandraS
Flight Engineer
Flight Engineer
  • 292 Views

Hi I had today the same problem with 4.18 version of DO188.

I had do move "USER student" after "RUN npm install --omit= dev" instruction to make it work.

Could you check please?

 

AlessandraS_0-1758103738643.png

 

 

 

Chetan_Tiwary_
Community Manager
Community Manager
  • 272 Views

@AlessandraS Sure let me check and get back to you!

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 264 Views

@AlessandraS I followed the lab in v4.18 and could complete the lab successfully by following the lab instructions step by step :

Chetan_Tiwary__0-1758138849634.png

Chetan_Tiwary__1-1758138872483.png

 

Chetan_Tiwary_
Community Manager
Community Manager
  • 262 Views

@AlessandraS You can see in the above screenshot - the Containerfile instructions that I used and which matches with the course solution.

Chetan_Tiwary_
Community Manager
Community Manager
  • 253 Views

0 Kudos
AlessandraS
Flight Engineer
Flight Engineer
  • 235 Views

OK thanks, I'll try again and check better my Containerfile

Chetan_Tiwary_
Community Manager
Community Manager
  • 185 Views

sure @AlessandraS ! 

0 Kudos
AlessandraS
Flight Engineer
Flight Engineer
  • 155 Views

Hi @Chetan_Tiwary_  I confirm that using the Containerfile instructions which match with the course solutions everything works fine.

In the Containerfile I created instead, I set the ENV and WORKDIR instructions after the second FROM statement, and this is the case in which an error occurs when building the image from the Containerfile.  Why it is not correct to put instructions in this order?

Thanks

My Containerfile

AlessandraS_0-1758286877660.png

Error I get building the image from it.AlessandraS_2-1758286986617.png

Travis
Moderator
Moderator
  • 148 Views

@AlessandraS - 

It all comes down to permissions. You're setting a working directory and creating files and setting thoes files to be owned by student initially. However, pay attention to ordering and WHO you are WHEN ...

So you are the ROOT user for copying and run commands, then all of a suddent you switch to the STUDENT user before running the npm commands. So you are getting a permission denied when attempting to make and create additional files/directories on the npm install piece.

 

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
Join the discussion
You must log in to join this conversation.