Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CompTIA Exam XK0-005 Topic 2 Question 32 Discussion

Actual exam question for CompTIA's XK0-005 exam
Question #: 32
Topic #: 2
[All XK0-005 Questions]

An operations engineer is planning to start a container running a PostgreSQL database. The engineer wants the container to start automatically at system startup, mount the /home/db directory as /var/lib/postgresql inside the container, and expose port 5432 to the OS. Which of the following commands should the engineer run to achieve this task?

Show Suggested Answer Hide Answer
Suggested Answer: A

systemctl status httpd is the correct option to check if the Apache web server (httpd) is running. The systemctl status command provides detailed information about the service, including whether it is active and running.


Contribute your Thoughts:

Devora
2 months ago
Wait, is it just me or does option A sound like a recipe for a delicious PostgreSQL-infused docker stew?
upvoted 0 times
...
Julio
2 months ago
Option D is a bit of a mess. The --init, --restart, and --workdir flags don't seem to be used correctly in this context.
upvoted 0 times
...
Jolene
2 months ago
Option C doesn't look right. The --attach flag is likely for attaching to a running container, not starting a new one. And the --platform flag doesn't seem relevant here.
upvoted 0 times
Arlene
24 days ago
A) docker run -d --restart always -p 5432:5432 -v /home/db:/var/lib/postgresql postgresql:12
upvoted 0 times
...
Skye
26 days ago
Yeah, I agree. Option C doesn't seem right. The --attach flag doesn't fit the scenario.
upvoted 0 times
...
Clarinda
30 days ago
B) docker run -d --restart -p 5432:5432 --volume /var/lib/postgresql:/home/db postgresql:12
upvoted 0 times
...
Amie
1 months ago
A) docker run -d --restart always -p 5432:5432 -v /home/db:/var/lib/postgresql postgresql:12
upvoted 0 times
...
...
My
2 months ago
I'm not sure about option B. The --volume flag seems to have the directory order reversed compared to option A.
upvoted 0 times
Jonell
1 months ago
User 3: Thanks for pointing that out. I'll go with option A to ensure the directory mapping is correct.
upvoted 0 times
...
Carolynn
1 months ago
User 2: I agree. Option B seems to have the directory order reversed, which could cause issues.
upvoted 0 times
...
Tom
2 months ago
User 1: Option A looks correct. The -v flag should be used to specify the volume mapping.
upvoted 0 times
...
...
Eulah
3 months ago
Option A seems correct. The --restart always flag ensures the container starts automatically at system startup, and the -v flag mounts the /home/db directory to the container's /var/lib/postgresql directory.
upvoted 0 times
Arthur
29 days ago
User 4: Sounds good, let's go with option A then.
upvoted 0 times
...
Jovita
1 months ago
User 3: And the -v flag will mount the directory correctly.
upvoted 0 times
...
Rosio
1 months ago
User 2: Yes, the --restart always flag will make sure the container starts at system startup.
upvoted 0 times
...
Micah
2 months ago
User 3: Thanks for clarifying. I will use docker run -d --restart always -p 5432:5432 -v /home/db:/var/lib/postgresql postgresql:12 to start the PostgreSQL container.
upvoted 0 times
...
Aaron
2 months ago
User 2: Yes, that's right. Option A is the correct command to achieve the desired task.
upvoted 0 times
...
Dona
2 months ago
User 1: Option A seems correct. The --restart always flag ensures the container starts automatically at system startup, and the -v flag mounts the /home/db directory to the container's /var/lib/postgresql directory.
upvoted 0 times
...
Paulina
2 months ago
User 1: I think option A is the right choice.
upvoted 0 times
...
...
Eugene
3 months ago
Why do you think B is the correct answer?
upvoted 0 times
...
Rozella
4 months ago
I disagree, I believe the correct answer is B.
upvoted 0 times
...
Eugene
4 months ago
I think the answer is A.
upvoted 0 times
...

Save Cancel