first commit
This commit is contained in:
9
data/mdns/build/Dockerfile
Normal file
9
data/mdns/build/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM ubuntu:22.04
|
||||
|
||||
RUN apt-get update && apt-get -y upgrade
|
||||
RUN apt-get -y install avahi-utils libnss-mdns dos2unix
|
||||
|
||||
ADD entrypoint.sh /opt/entrypoint.sh
|
||||
RUN dos2unix /opt/entrypoint.sh ; chmod +x /opt/entrypoint.sh
|
||||
|
||||
CMD ["sh", "/opt/entrypoint.sh"]
|
||||
15
data/mdns/build/entrypoint.sh
Normal file
15
data/mdns/build/entrypoint.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
service dbus start
|
||||
service avahi-daemon start
|
||||
|
||||
dos2unix /opt/config/names.csv
|
||||
|
||||
while read LINE; do
|
||||
PUBLISH_HOSTNAME=$(echo $LINE | cut -d ";" -f 1)
|
||||
PUBLISH_IP=$(echo $LINE | cut -d ";" -f 2)
|
||||
echo "$PUBLISH_HOSTNAME - $PUBLISH_IP"
|
||||
/usr/bin/avahi-publish -a -R $PUBLISH_HOSTNAME $PUBLISH_IP &
|
||||
done < /opt/config/names.csv
|
||||
|
||||
tail -f /dev/null
|
||||
3
data/mdns/config/names.csv
Normal file
3
data/mdns/config/names.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
opensearch.local;192.168.57.2
|
||||
traefik.local;192.168.57.2
|
||||
grafana.local;192.168.57.2
|
||||
|
Reference in New Issue
Block a user