host snippets

How to access the host from a docker container

Tagged container, docker, host, ip  Languages bash

Access host from docker container IP:

# Mac
ping docker.for.mac.localhost

# Windows

# Linux: use the hosts external IP, see:

Note that it’s not possible to use host networking on Mac or Windows, only Linux:

The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.


SSH jump host

Tagged host, jump, ssh  Languages bash
# Connect to server-b by going through server-a (you => server-a => server-b):
$ ssh -t <user>@<server-a> ssh <server-b>