BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Docker DCA Exam - Topic 6 Question 113 Discussion

Posted by Gladys on Jul 07, 2025 at 03:22 AM

You want to create a container that is reachable from its host's network. Does this action accomplish this?

Solution: Use --link to access the container on the bridge network.

Suggested Answer: B

= The action of using--linkto access the container on the bridge network doesnotaccomplish the goal of creating a container that is reachable from its host's network.The--linkoption allows you to connect containers that are running on the same network, but it doesnotexpose the container's ports to the host1.To create a container that is reachable from its host's network, you need to use the--network hostoption, which attaches the container to the host's network stack and makes it share the host's IP address2.Alternatively, you can use the--publishor-poption to map the container's ports to the host's ports3.

: :Legacy container links | Docker Documentation:Networking using the host network | Docker Documentation:docker run reference | Docker Documentation


Get Premium DCA Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
28 comments · newest first
AR
Arminda 11 months ago
Really? I didn't know that!
MA
Ma 11 months ago
I thought --link was deprecated though?
CA
Carmela 12 months ago
No, you need to use --network instead.
AD
Adell 12 months ago
Definitely not the best practice anymore.
CL
Claudio 1 year ago
Yes, --link is a way to connect containers!
JA
Jacquelyne 1 year ago
I vaguely remember that to expose a container to the host, you usually need to use port mapping instead of --link.
MI
Michal 1 year ago
I'm a bit unsure, but I thought --link was mainly for communication between containers on the same network, not for host access.
VA
Valentin 1 year ago
I feel like I practiced a question similar to this, and I think the answer was no. The --link option is outdated for networking.
AM
Amie 1 year ago
I think using --link might not actually make the container reachable from the host's network. I remember it being more about connecting containers rather than exposing them.
MI
Mitsue 1 year ago
The key here is that we want the container to be reachable from the host's network, not just the bridge network. The solution mentions --link, which I believe is used for linking containers, not making them accessible from the host. I'll need to review my networking concepts to be sure.
RA
Raymon 1 year ago
Wait, I'm a little confused. Isn't the bridge network just for internal container-to-container communication? I'm not sure that would make the container reachable from the host's network. I'll have to think this through more carefully.
ST
Staci 1 year ago
Okay, I think I know the answer to this. Connecting a container to the bridge network should make it reachable from the host's network. Let me double-check the details, but I'm feeling confident about this.
RO
Rodolfo 1 year ago
Hmm, I'm not sure about this one. The solution mentions using --link, but I'm not familiar with that Docker command. I'll need to review my notes on networking containers.
MI
Milly 1 year ago
Yes, I agree with Pete. Using --link is the solution for accessing the container on the bridge network.
PA
Paris 1 year ago
No, I think there might be other ways to make the container reachable.
VI
Vicente 1 year ago
Wait, is this a trick question? I'm pretty sure the --link option is not the way to go these days. Gotta be B, right?
PA
Pansy 1 year ago
Seriously? --link? What is this, 2015? Everyone knows you use the bridge network these days. Time to get with the times, folks.
BE
Beckie 1 year ago
↳ replying to Pansy
No
TW
Twanna 1 year ago
↳ replying to Pansy
Yes
RA
Raylene 1 year ago
Ah, the old --link trick. Brings back memories of the good ol' days of Docker. But hey, at least it gets the job done!
PE
Pete 1 year ago
Yes, using --link allows access on the bridge network.
BE
Bea 1 year ago
No way, that can't be right. Didn't they switch to using the bridge network by default? Time to hit the docs again.
MI
Milly 1 year ago
↳ replying to Bea
Yes, you're right. We should double-check the documentation to be sure.
PA
Pauline 1 year ago
↳ replying to Bea
No, I don't think that's correct. They switched to using the bridge network by default.
LO
Lorriane 1 year ago
Hmm, I thought the --link option was deprecated. Guess I need to brush up on my container networking!
EL
Elke 1 year ago
↳ replying to Lorriane
Hmm, I thought the --link option was deprecated. Guess I need to brush up on my container networking!
TA
Tamesha 1 year ago
↳ replying to Lorriane
B) No
NI
Nikita 1 year ago
↳ replying to Lorriane
A) Yes
0/2000 characters

Save Cancel