nerdexam
Cisco

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…

Application Deployment and Security

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

200-901 question #610 exhibit

Options

  • A/source
  • B/app
  • C/app/source
  • D/app/production

How the community answered

(31 responses)
  • A
    3% (1)
  • B
    94% (29)
  • D
    3% (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

#Docker#Dockerfile#Containerization#Working Directory

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice