200-901 · Question #610
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?
The correct answer is B. /app. In a Dockerfile, the WORKDIR instruction sets the working directory for subsequent instructions (RUN, CMD, ENTRYPOINT, COPY, ADD) and for the running container. Based on the exhibit, the Dockerfile contains a 'WORKDIR /app' directive, which establishes /app as the working…
Question
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?
Exhibit
Options
- A/source
- B/app
- C/app/source
- D/app/production
How the community answered
(31 responses)- A3% (1)
- B94% (29)
- D3% (1)
Explanation
In a Dockerfile, the WORKDIR instruction sets the working directory for subsequent instructions (RUN, CMD, ENTRYPOINT, COPY, ADD) and for the running container. Based on the exhibit, the Dockerfile contains a 'WORKDIR /app' directive, which establishes /app as the working directory. Any files copied into the container using COPY or ADD after this instruction land in /app, and the CMD or ENTRYPOINT that launches server.js runs from /app. Options A (/source), C (/app/source), and D (/app/production) do not match the WORKDIR value set in the Dockerfile. The working directory is /app.
Topics
Community Discussion
No community discussion yet for this question.
