From 67865271011e9cffb1c2c9ae2795fe764e0bebc2 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 12 Sep 2021 20:45:15 +0000 Subject: [PATCH] Refactor (generate): Remove Dockerfile.header.ps1 and Dockerfile.footer.ps1 and only use Dockerfile.ps1 --- generate/definitions/VARIANTS.ps1 | 4 ++-- generate/templates/Dockerfile.footer.ps1 | 2 -- generate/templates/Dockerfile.header.ps1 | 3 --- generate/templates/Dockerfile.ps1 | 12 +++++++----- variants/3.10-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.10-mysqlclient-openssl/Dockerfile | 2 -- variants/3.11-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.11-mysqlclient-openssl/Dockerfile | 2 -- variants/3.12-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.12-mysqlclient-openssl/Dockerfile | 2 -- variants/3.8-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.8-mysqlclient-openssl/Dockerfile | 2 -- variants/3.9-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.9-mysqlclient-openssl/Dockerfile | 2 -- 14 files changed, 9 insertions(+), 32 deletions(-) delete mode 100644 generate/templates/Dockerfile.footer.ps1 delete mode 100644 generate/templates/Dockerfile.header.ps1 diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index e96e310..4a5069d 100644 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -50,8 +50,8 @@ $VARIANTS_SHARED = @{ templates = @{ 'Dockerfile' = @{ common = $true - includeHeader = $true - includeFooter = $true + includeHeader = $false + includeFooter = $false passes = @( @{ variables = @{} diff --git a/generate/templates/Dockerfile.footer.ps1 b/generate/templates/Dockerfile.footer.ps1 deleted file mode 100644 index d008103..0000000 --- a/generate/templates/Dockerfile.footer.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -@" -"@ diff --git a/generate/templates/Dockerfile.header.ps1 b/generate/templates/Dockerfile.header.ps1 deleted file mode 100644 index f379361..0000000 --- a/generate/templates/Dockerfile.header.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -@" -FROM $( $VARIANT['_metadata']['distro'] ):$( $VARIANT['_metadata']['distro_version'] ) -"@ diff --git a/generate/templates/Dockerfile.ps1 b/generate/templates/Dockerfile.ps1 index 3ca9fd3..0bc2f2b 100644 --- a/generate/templates/Dockerfile.ps1 +++ b/generate/templates/Dockerfile.ps1 @@ -1,6 +1,10 @@ @" -$( -($VARIANT['_metadata']['components'] | % { +FROM $( $VARIANT['_metadata']['distro'] ):$( $VARIANT['_metadata']['distro_version'] ) + + +"@ + +$VARIANT['_metadata']['components'] | % { $component = $_ switch( $component ) { @@ -58,6 +62,4 @@ RUN apk add --no-cache openssh throw "No such component: $component" } } -}) -join '' -) -"@ +} diff --git a/variants/3.10-curl-git-jq-ssh/Dockerfile b/variants/3.10-curl-git-jq-ssh/Dockerfile index d1bf021..72cb812 100644 --- a/variants/3.10-curl-git-jq-ssh/Dockerfile +++ b/variants/3.10-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.10-mysqlclient-openssl/Dockerfile b/variants/3.10-mysqlclient-openssl/Dockerfile index 2473515..3900613 100644 --- a/variants/3.10-mysqlclient-openssl/Dockerfile +++ b/variants/3.10-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - diff --git a/variants/3.11-curl-git-jq-ssh/Dockerfile b/variants/3.11-curl-git-jq-ssh/Dockerfile index 7e5c85c..50dd380 100644 --- a/variants/3.11-curl-git-jq-ssh/Dockerfile +++ b/variants/3.11-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.11-mysqlclient-openssl/Dockerfile b/variants/3.11-mysqlclient-openssl/Dockerfile index d3be6e5..ee217fa 100644 --- a/variants/3.11-mysqlclient-openssl/Dockerfile +++ b/variants/3.11-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - diff --git a/variants/3.12-curl-git-jq-ssh/Dockerfile b/variants/3.12-curl-git-jq-ssh/Dockerfile index 2de8cca..c9370ae 100644 --- a/variants/3.12-curl-git-jq-ssh/Dockerfile +++ b/variants/3.12-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.12-mysqlclient-openssl/Dockerfile b/variants/3.12-mysqlclient-openssl/Dockerfile index b4cb6c3..3b55aed 100644 --- a/variants/3.12-mysqlclient-openssl/Dockerfile +++ b/variants/3.12-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - diff --git a/variants/3.8-curl-git-jq-ssh/Dockerfile b/variants/3.8-curl-git-jq-ssh/Dockerfile index 6ad16d8..45c8871 100644 --- a/variants/3.8-curl-git-jq-ssh/Dockerfile +++ b/variants/3.8-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.8-mysqlclient-openssl/Dockerfile b/variants/3.8-mysqlclient-openssl/Dockerfile index 0c1a952..1fe1c55 100644 --- a/variants/3.8-mysqlclient-openssl/Dockerfile +++ b/variants/3.8-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - diff --git a/variants/3.9-curl-git-jq-ssh/Dockerfile b/variants/3.9-curl-git-jq-ssh/Dockerfile index 62777ea..9bc61fb 100644 --- a/variants/3.9-curl-git-jq-ssh/Dockerfile +++ b/variants/3.9-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.9-mysqlclient-openssl/Dockerfile b/variants/3.9-mysqlclient-openssl/Dockerfile index 56d8d45..ee7672c 100644 --- a/variants/3.9-mysqlclient-openssl/Dockerfile +++ b/variants/3.9-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - -