New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CompTIA XK0-005 Exam - 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:

0/2000 characters
Lorriane
3 months ago
I disagree with C. The flags don't match the requirements.
upvoted 0 times
...
Xuan
3 months ago
Wait, does PostgreSQL really need that specific volume path?
upvoted 0 times
...
Thaddeus
3 months ago
A is definitely the way to go.
upvoted 0 times
...
Erasmo
4 months ago
I think B is wrong. The volume paths are swapped!
upvoted 0 times
...
Oneida
4 months ago
Option A looks correct. It has the right flags.
upvoted 0 times
...
Malcom
4 months ago
I’m leaning towards option A since it seems to have all the right components, but I’m a bit confused about the volume paths in the other options.
upvoted 0 times
...
Ben
4 months ago
I practiced a similar question, and I feel like the `-p` flag is definitely for exposing ports, but I can't recall if the order of options matters.
upvoted 0 times
...
Elly
4 months ago
I think option A looks familiar because it has the correct volume mount, but I’m not completely sure about the syntax for the restart policy.
upvoted 0 times
...
Brynn
5 months ago
I remember something about using the `--restart` flag, but I’m not sure if it should be `always` or something else.
upvoted 0 times
...
Margret
5 months ago
I'm feeling pretty confident about this one. The first option looks like the correct command to meet all the requirements stated in the question.
upvoted 0 times
...
Brock
5 months ago
The question is asking about exposing a port, so I'll need to make sure I use the correct syntax for that as well. Let me review the options again carefully.
upvoted 0 times
...
Broderick
5 months ago
Hmm, I'm a bit unsure about the volume mapping. I'll need to double-check the correct syntax for mounting a host directory to a container path.
upvoted 0 times
...
Rana
5 months ago
This looks like a straightforward Docker container setup question. I'll carefully read through the options and think about the specific requirements mentioned.
upvoted 0 times
...
Sena
5 months ago
Okay, I think I've got this. The key is to use the --restart always flag to ensure the container starts automatically, and the -v flag to map the host directory to the container path.
upvoted 0 times
...
Katina
5 months ago
I'm not totally sure about consensus methods, but I think it has to do with getting agreement from multiple nodes on a network. I'll try to remember that and see if I can narrow it down from there.
upvoted 0 times
...
Malinda
5 months ago
I practiced a similar question last week, and I believe the perspectives include internal processes and financial performance. But I can't remember if "workforce learning" is right.
upvoted 0 times
...
Devora
9 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
9 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
10 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
8 months ago
A) docker run -d --restart always -p 5432:5432 -v /home/db:/var/lib/postgresql postgresql:12
upvoted 0 times
...
Skye
8 months ago
Yeah, I agree. Option C doesn't seem right. The --attach flag doesn't fit the scenario.
upvoted 0 times
...
Clarinda
8 months ago
B) docker run -d --restart -p 5432:5432 --volume /var/lib/postgresql:/home/db postgresql:12
upvoted 0 times
...
Amie
8 months ago
A) docker run -d --restart always -p 5432:5432 -v /home/db:/var/lib/postgresql postgresql:12
upvoted 0 times
...
...
My
10 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
8 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
8 months ago
User 2: I agree. Option B seems to have the directory order reversed, which could cause issues.
upvoted 0 times
...
Tom
9 months ago
User 1: Option A looks correct. The -v flag should be used to specify the volume mapping.
upvoted 0 times
...
...
Eulah
10 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
8 months ago
User 4: Sounds good, let's go with option A then.
upvoted 0 times
...
Jovita
8 months ago
User 3: And the -v flag will mount the directory correctly.
upvoted 0 times
...
Rosio
9 months ago
User 2: Yes, the --restart always flag will make sure the container starts at system startup.
upvoted 0 times
...
Micah
9 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
9 months ago
User 2: Yes, that's right. Option A is the correct command to achieve the desired task.
upvoted 0 times
...
Dona
9 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
9 months ago
User 1: I think option A is the right choice.
upvoted 0 times
...
...
Eugene
11 months ago
Why do you think B is the correct answer?
upvoted 0 times
...
Rozella
11 months ago
I disagree, I believe the correct answer is B.
upvoted 0 times
...
Eugene
11 months ago
I think the answer is A.
upvoted 0 times
...

Save Cancel