Push the build files
This commit is contained in:
parent
688a0be387
commit
18b572dc44
2 changed files with 40 additions and 0 deletions
20
Dockerfile
Normal file
20
Dockerfile
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
FROM alpine:3.22.0
|
||||||
|
|
||||||
|
RUN apk add --no-cache build-base bash docker-cli git \
|
||||||
|
&& git clone -b add-ipv6-support https://github.com/Alphix/mdns-repeater.git \
|
||||||
|
&& cd mdns-repeater \
|
||||||
|
&& make \
|
||||||
|
&& mv mdns-repeater /bin \
|
||||||
|
&& chmod a+x /bin/mdns-repeater \
|
||||||
|
&& apk del build-base git \
|
||||||
|
&& rm -rf /var/cache/apk/* /tmp/*
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod a+x entrypoint.sh
|
||||||
|
|
||||||
|
ENV USE_MDNS_REPEATER=1 \
|
||||||
|
OPTIONS="" \
|
||||||
|
INTERFACES="eth0" \
|
||||||
|
DOCKER_NETWORKS="net1 net2"
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
20
entrypoint.sh
Normal file
20
entrypoint.sh
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ifnames=(${INTERFACES})
|
||||||
|
|
||||||
|
# determine interface names for all given docker networks
|
||||||
|
for dn in ${DOCKER_NETWORKS}; do
|
||||||
|
ifname=$(docker network list | grep "$dn" | awk '{print $1}')
|
||||||
|
if [[ -z $ifname ]]; then
|
||||||
|
echo "unable to find docker interface for $dn" > /dev/stderr
|
||||||
|
fi
|
||||||
|
|
||||||
|
ifnames+=("br-$ifname")
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ ${USE_MDNS_REPEATER} -eq 1 ]]; then
|
||||||
|
exec mdns-repeater ${OPTIONS} ${ifnames[@]}
|
||||||
|
else
|
||||||
|
# If the local user has disabled the app, then just sleep forever
|
||||||
|
sleep infinity
|
||||||
|
fi
|
Loading…
Add table
Add a link
Reference in a new issue