Sign inSign up

nbarnum/containerip

By nbarnum

Updated about 7 years ago

Go HTTP server returns container's IPv4 addresses

Image
0

1.4K

nbarnum/containerip repository overview

containerip

Go HTTP server returns all of the container's IPv4 addresses.

Docker

Use existing image

Run the container:

$ docker run --rm -it -p 8080:80 nbarnum/containerip

Get the IP:

$ curl http://localhost:8080
172.17.0.2

Get the hostname:

$ curl http://localhost:8080/hostname
1dc38af96b21
Build Docker image

Build the image:

$ docker build -t $USER/containerip .

Clean up intermediate containers left behind from multi-stage Dockerfile:

$ docker system prune

Run the container:

$ docker run --rm -it -p 8080:80 $USER/containerip

Tag summary

Content type

Image

Digest

Size

2.2 MB

Last updated

about 7 years ago

docker pull nbarnum/containerip