ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 302 - XK0-005 discussion

Report
Export

A Linux administrator needs to expose port 9000 for a container to listen during runtime. The Linux administrator creates a Dockerfile with the following entries:

sql

FROM node:9-alpine

WORKDIR /usr/src/app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 9000

CMD ['npm', 'start']

Which of the following commands should the administrator use to accomplish this task? (Select two).

A.

docker build -t Test-Container

Answers
A.

docker build -t Test-Container

B.

docker tag Test-Container

Answers
B.

docker tag Test-Container

C.

docker inspect Test-Container

Answers
C.

docker inspect Test-Container

D.

docker run -p 5000:80 Test-Container

Answers
D.

docker run -p 5000:80 Test-Container

E.

docker push Test-Container

Answers
E.

docker push Test-Container

F.

docker run -p 80:9000 Test-Container

Answers
F.

docker run -p 80:9000 Test-Container

Suggested answer: A, F

Explanation:

First, the administrator should build the container image using the command docker build -t Test-Container, which creates a Docker image with the specified configuration. To run the container and expose port 9000, the correct command is docker run -p 80:9000 Test-Container, which maps the container's port 9000 to port 80 on the host machine, making the service accessible externally on port 80.

asked 09/10/2024
frederic Morteau
31 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first