From 688ce2811b60047849c8765510245a095a8ab8b2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 17 Mar 2020 17:39:36 +0300 Subject: fr24feed: OMG, even more stages --- fr24feed/Dockerfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/fr24feed/Dockerfile b/fr24feed/Dockerfile index dd44831..a067988 100644 --- a/fr24feed/Dockerfile +++ b/fr24feed/Dockerfile @@ -24,11 +24,17 @@ ENV fr24feed_version=1.0.25-1 ENV fr24feed_archive_suffix=armhf ARG TARGETARCH -FROM env-$TARGETARCH - -LABEL maintainer="Egor Tensin " +FROM env-$TARGETARCH AS builder ENV fr24feed_archive_name="fr24feed_${fr24feed_version}_${fr24feed_archive_suffix}.tgz" +WORKDIR /tmp +ADD ["https://repo-feed.flightradar24.com/$fr24feed_directory/$fr24feed_archive_name", "./"] +RUN tar xzf "$fr24feed_archive_name" +ENV fr24feed_directory="fr24feed_${fr24feed_archive_suffix}" + +FROM builder + +LABEL maintainer="Egor Tensin " # Don't prompt: ENV DEBIAN_FRONTEND=noninteractive @@ -38,14 +44,10 @@ RUN runtime_deps='ca-certificates procps' && \ apt-get update -yq && \ apt-get install -yq --no-install-recommends $runtime_deps -WORKDIR /tmp -ADD ["https://repo-feed.flightradar24.com/$fr24feed_directory/$fr24feed_archive_name", "./"] -RUN tar xzf "$fr24feed_archive_name" && \ - rm -- "$fr24feed_archive_name" - +COPY --from=builder ["/tmp/$fr24feed_directory", "/tmp/"] COPY ["fr24feed.ini", "/etc/"] EXPOSE 8754 -WORKDIR "fr24feed_${fr24feed_archive_suffix}" +WORKDIR "/tmp/$fr24feed_directory" CMD ["./fr24feed"] -- cgit v1.2.3