Sign inSign up

glazeus/hostname

By glazeus

•Updated about 6 years ago

run httpd service on alpine that show hostname | for load balancer troubleshooting

Image
1

3.1K

glazeus/hostname repository overview

it will run httpd service on alpine that show hostname and IP(s)

You can pull it from dockerhub or create by yourself

docker build -t glazeus/hostname . && docker run -it -e "DockerHostIPs='$(hostname -I)'" -e "DockerHostName='$(hostname)'" -v /etc/hostname:/etc/MAINhostname glazeus/hostname

Dockerfile

FROM httpd MAINTAINER RJ COPY hostname.sh /home/hostname.sh RUN chmod +x /home/hostname.sh CMD /home/hostname.sh

hostname.sh

#Display hostname and IP(s) for current container echo "Hostname: $HOSTNAME | IP(s): $(hostname -I)" > '/usr/local/apache2/htdocs/index.html' #Run web server httpd -DFOREGROUND

Tag summary

Content type

Image

Digest

Size

65.7 MB

Last updated

about 9 years ago

docker pull glazeus/hostname