run httpd service on alpine that show hostname | for load balancer troubleshooting
3.1K
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
Content type
Image
Digest
Size
65.7 MB
Last updated
about 9 years ago
docker pull glazeus/hostname