myip Get local public IP address Usage Build image firstly docker build -t myip . Run docker run -it myip For Mac users, you can pipe the result into clipboard directly docker run -it myip | pbcopy