docker: connecting to localhost outside the container (intermediate) anthony explains #555

preview_player
Показать описание
today we talk about docker loopback -- how to navigate docker networking to allow connections to the host machine localhost instead of the in-container localhost!

==========

I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
Рекомендации по теме
Комментарии
Автор

This is very interesting! This networking quirks is why I almost always use compose to run containers locally

mrswats
Автор

docker network inspect bridge --format='{{(index .IPAM.Config 0).Gateway}}'

fabiomanzo
Автор

Oh wow, I've been wanting to do this for a while and didn't think it was possible (at least, easily). Thanks!

ltn
Автор

Did not know this about docker. Always glad to learn new things.

hrvojematosevic
Автор

I was actually researching on a network concept, and somehow this pops up 😂
Still answered my question tho

theobotchway
Автор

You just save my day!! thks so much !!

jcbrunhera
Автор

thanks for sharing this knowledge. I also was other here that struggled with this topic for some time. Your video was very helpfull. New follower of your content here =)

rafaelrosenberg
Автор

Thanks for sharing this information, have you ever tried zenoh communication between host and docker containers? Like zenoh pub sub ?

Автор

Cool, is it possible to add more of the docker internal addresses? I am currently planning a project where i have 3 containers that i need for each one of them to have an internal ip address that could communicate with local hosts..

ghost_
Автор

Interestingly, I can't seem to replicate this on macOS. I still get a connection refused running these exact same commands. I wonder if local firewall rules are disrupting the connection? Hmm

namanrawal
Автор

Are you still able to issue requests to localhost outside of docker even after you bind to the docker bridge network IP?

sgeisenh
Автор

Where do you open terminal? In docker? What about Windows users?? Thx

nildesperandum
Автор

Hi, Thanks for your video its very informative. I was wondering if you can help me with an issue I'm facing. I have enabled dockerdesktop host networking and inside the docker-compose I have created the loopback using extra_hosts: <ip>=host-gateway. The image Im using is for Apache Nifi and in Nifi you can specify the HTTPS_HOST to bind the application to, however I keep getting the error : java.io.IOException: Failed to bind <- Cannot assign requested address. Why is that ? the host ip has been added to the /etc/hosts ! My goal is to access nifi from any machine on the network and for that I need to use the host IP. Is there a way to go around this error and still access the app from the host network? Thank

samsal
Автор

I started trying to do the same in podman, and turns out host.containers.internal is just there by default.

clorzz
Автор

hey can you help me out i want to access the camera from docker jupyte lab so how can i do it.

RajatNair
Автор

is there a way to get the access to loopback in linux instead of windows or macos? i think host docker internal does not work...

antoniofernandodiasjunior
Автор

Can you use "docker run --network host" instead of bridge?

bcodetube
Автор

Hello,

I was looking at your video channel. We may be helping a company that uses secure images to increase supply chain security and help cloud native development. Would you be willing to help try their software, make a video, and help show devs how to use their tools?

This is not an offer, but just to start a conversation about your willingness to take on sponsorship. The video can be from 5 to 10 minutes long.

You'd have a chance to look at their technology and decide if it's the type of software that you'd be interested in covering in your channel. Please provide us with your pricing.

IleniaQuintero