FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1-398

ARG version=1.2.6

ADD packages.yaml License.txt /licenses/
RUN microdnf update -y \
    && microdnf install -y tar gzip wget ca-certificates \
    && wget https://github.com/coredns/coredns/releases/download/v$version/coredns_$version\_linux_amd64.tgz \  
    && tar -zxvf coredns_$version\_linux_amd64.tgz \
    && rm -f coredns_$version\_linux_amd64.tgz

EXPOSE 53 53/udp
ENTRYPOINT ["/coredns"]
