FROM casjaysdevdocker/alpine:latest as build ARG LICENSE=WTFPL \ IMAGE_NAME=youtube-dl \ TIMEZONE=America/New_York \ PORT= ENV SHELL=/bin/bash \ TERM=xterm-256color \ HOSTNAME=${HOSTNAME:-casjaysdev-$IMAGE_NAME} \ TZ=$TIMEZONE RUN mkdir -p /bin/ /config/ /data/ && \ rm -Rf /bin/.gitkeep /config/.gitkeep /data/.gitkeep && \ apk update -U --no-cache && \ apk add --no-cache \ ffmpeg \ aria2c \ py3-pip && \ curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl && \ curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \ chmod a+rx /usr/local/bin/yt-dlp /usr/local/bin/youtube-dl COPY ./bin/. /usr/local/bin/ COPY ./config/. /config/ COPY ./data/. /data/ FROM scratch ARG BUILD_DATE="$(date +'%Y-%m-%d %H:%M')" LABEL org.label-schema.name="youtube-dl" \ org.label-schema.description="Containerized version of youtube-dl" \ org.label-schema.url="https://hub.docker.com/r/casjaysdevdocker/youtube-dl" \ org.label-schema.vcs-url="https://github.com/casjaysdevdocker/youtube-dl" \ org.label-schema.build-date=$BUILD_DATE \ org.label-schema.version=$BUILD_DATE \ org.label-schema.vcs-ref=$BUILD_DATE \ org.label-schema.license="$LICENSE" \ org.label-schema.vcs-type="Git" \ org.label-schema.schema-version="latest" \ org.label-schema.vendor="CasjaysDev" \ maintainer="CasjaysDev " ENV SHELL="/bin/bash" \ TERM="xterm-256color" \ HOSTNAME="casjaysdev-youtube-dl" \ TZ="${TZ:-America/New_York}" WORKDIR /root VOLUME ["/config","/data"] EXPOSE $PORT COPY --from=build /. / ENTRYPOINT [ "tini", "--" ] HEALTHCHECK CMD [ "/usr/local/bin/entrypoint-youtube-dl.sh", "healthcheck" ] CMD [ "/usr/local/bin/entrypoint-youtube-dl.sh" ]