ExamGecko
Question list
Search
Search

Question 465 - 200-901 discussion

Report
Export

Refer to the exhibit.

The server.js Node.js script runs after the Dockerfile creates its container. What is the working directory of the application inside the container?

A.

/source

Answers
A.

/source

B.

/app

Answers
B.

/app

C.

/app/source

Answers
C.

/app/source

D.

/app/produclion

Answers
D.

/app/produclion

Suggested answer: B

Explanation:

In the given Dockerfile, the WORKDIR /app command sets the working directory for any subsequent commands to /app. This means that any commands following this line will be executed within the /app directory inside the Docker container. The COPY . . command copies the contents of the current directory on the host machine to the /app directory in the container. Finally, the CMD ['node', 'source/server.js'] command specifies the command to run when the container starts, which in this case is node source/server.js.

Dockerfile Reference - WORKDIR

asked 07/10/2024
Sandesh Somaiah
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first