Docker Introduction

Hello I am having issues understanding what to do here. it says to edit app.js I dont understand please can anyone help

The command cat > app.js <<EOF streams what you type on the console to the file app.js till you enter the end of stream token EOF.

So, execute the code block in step 3 from inside the test directory to create app.js with the correct contents. After that, build the docker file and run it locally to test the nodejs process response on port 80.

I am sorry sir; this is a high-level explanation at least for me now. Please do you suggest I run step 3 before running step 2. I don’t understand what you mean by running it in the test directory.

Here’s a rough outline of the lab:

  1. Run a hello-world container (to get your feet wet)
  2. Build a custom image with the provided code.
  3. Deploy the custom image locally.
  4. Invoke an HTTP endpoint to receive response from the deployed container.

Please run steps in the provided order in the writeup. Don’t run step 3 before step 2.

The explanation provided by the google team is top notch for this lab.
Follow them carefully and you should be good to go.

If you’re uncomfortable with shell programming / docker, there are a lot of online tutorials and coursera courses out there that explain these concepts pretty well.

thank you for taking the time to get me to understand. it asked to close the initial shell then run


edit the app.js of which if i copy the code and paste it on the terminal
I get command not found this is where I am having trouble. so what should I edit before I run it. thank you for your time.

You’re welcome.
The writeup asks you to create a file with name app.js with the correct contents. You can either open the file and paste the contents within the cat and EOF blocks or use the code cell and write the content. The file should have contents starting with const and ending with });.

I see you’re have problems with shell programming. Please spend some time to familiarize yourself with the bash shell.

1 Like

okay. thank you so much I will definitely spend time on shell programming…

you’ve been so helpful. thank you