From d8e95509d89f64bdef3c3487b08cd12c0a0fb880 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 19 Dec 2020 15:03:58 +0200
Subject: [PATCH] Split the build stage to smaller steps.

Easier to iterate when debugging with better caching.
---
 Dockerfile | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 6abe613..3c3aa4f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,14 +15,11 @@ RUN apk add --update --no-cache \
     ;
 ARG Version
 ENV VERSION="$Version"
-# hadolint ignore=DL3020
-ADD "https://github.com/varnish/hitch/archive/${VERSION}.tar.gz" /
+RUN wget "https://github.com/varnish/hitch/archive/${VERSION}.tar.gz" && \
+    tar --no-same-owner --no-same-permissions -xzf "${VERSION}.tar.gz"
 ENV LDFLAGS="--static"
-# hadolint ignore=DL3003
-RUN tar -xzf "${VERSION}.tar.gz" && \
-    cd "hitch-${VERSION}" && \
-    ./bootstrap && \
-    ./configure && \
+WORKDIR /hitch-$Version
+RUN ./bootstrap && \
     make && \
     make install
 
-- 
GitLab