ARG NGINX_VERSION=${NGINX_VERSION}
FROM --platform=$TARGETPLATFORM entplus.jfrog.io/jfrog-docker/nginx:${NGINX_VERSION}

ARG TARGETARCH

ENV TARGETARCH=${TARGETARCH} \
    SUPERCRONIC_VERSION=0.2.44

COPY Dockerfile /docker/art-nginx/

RUN apk --no-cache add shadow && \
    apk --no-cache add libcap && \
    apk --no-cache add bash && \
    apk --no-cache add logrotate && \
    apk --no-cache add openssl && \
    apk --no-cache add --update busybox-suid && \
    apk --no-cache upgrade curl libcurl apk-tools && \
    apk del nginx-module-xslt nginx-module-image-filter

RUN curl -L https://releases.jfrog.io/artifactory/installers/supercronic/supercronic/${SUPERCRONIC_VERSION}/supercronic-linux-$TARGETARCH -o /usr/bin/supercronic && \
    chmod +x /usr/bin/supercronic