diff --git a/Dockerfile b/Dockerfile index 1617871..7da7d79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,12 @@ FROM docker.io/alpine:latest AS builder +RUN apk add --no-cache build-base linux-headers + +COPY mdns-repeater.c /src/ +RUN gcc -static -O2 -o /mdns-repeater /src/mdns-repeater.c -lpthread + +FROM docker.io/alpine:latest AS runtime + LABEL org.opencontainers.image.created="%%CREATED%%" LABEL org.opencontainers.image.authors="Ricardo Band " LABEL org.opencontainers.image.url="https://git.sb20.xengi.de/xengi/mdns-reflector" @@ -9,13 +16,6 @@ LABEL org.opencontainers.image.revision="%%COMMIT%%" LABEL org.opencontainers.image.title="mdns-reflector" LABEL org.opencontainers.image.description="IPv4 + IPv6 mDNS reflector for MikroTik RouterOS" -RUN apk add --no-cache build-base linux-headers - -COPY mdns-repeater.c /src/ -RUN gcc -static -O2 -o /mdns-repeater /src/mdns-repeater.c -lpthread - -FROM docker.io/alpine:latest as runtime - COPY --from=builder /mdns-repeater /usr/local/bin/ COPY --chmod=755 entrypoint.sh / COPY --chmod=755 healthcheck.sh /usr/local/bin/