From 711ae95c49064a9e0eabd9c10829dfa07cb4e2ca Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Tue, 19 May 2020 19:29:27 +0800 Subject: [PATCH 1/2] fix Build_Date for docker images --- tools/Docker/BuildImages.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/Docker/BuildImages.ps1 b/tools/Docker/BuildImages.ps1 index 2940c5be2dac..f48eec174b19 100644 --- a/tools/Docker/BuildImages.ps1 +++ b/tools/Docker/BuildImages.ps1 @@ -22,6 +22,7 @@ param( Import-LocalizedData -BaseDirectory $PSScriptRoot"\..\Az" -FileName "Az.psd1" -BindingVariable AzMetaData $version = $AzMetaData.ModuleVersion Write-Output "Az version: "$version" retrieved, from Az.psd1" +$Date = date -u +'%Y-%m-%dT%H:%M:%SZ' try { foreach ($dockerfile in (Get-ChildItem -Path $DOCKER -Filter "Dockerfile-*").FullName) { @@ -29,13 +30,13 @@ try { Write-Output $os if ($os -eq "ubuntu-18.04") { docker build --build-arg VERSION=$version ` - --build-arg BUILD_DATE="date -u +'%Y-%m-%dT%H:%M:%SZ'" ` + --build-arg BUILD_DATE=$Date ` --tag $DockerImageName':'$version"-"$os ` --tag $DockerImageName':latest' ` -f $dockerfile $DOCKER }else { docker build --build-arg VERSION=$version ` - --build-arg BUILD_DATE="date -u +'%Y-%m-%dT%H:%M:%SZ'" ` + --build-arg BUILD_DATE=$Date ` --tag $DockerImageName':'$version"-"$os ` -f $dockerfile $DOCKER } From 10d97b3d6a634b2affe6f9af33d3a6437a61066c Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Wed, 20 May 2020 23:01:21 +0800 Subject: [PATCH 2/2] Update BuildImages.ps1 --- tools/Docker/BuildImages.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/Docker/BuildImages.ps1 b/tools/Docker/BuildImages.ps1 index f48eec174b19..9abfef08a367 100644 --- a/tools/Docker/BuildImages.ps1 +++ b/tools/Docker/BuildImages.ps1 @@ -22,7 +22,7 @@ param( Import-LocalizedData -BaseDirectory $PSScriptRoot"\..\Az" -FileName "Az.psd1" -BindingVariable AzMetaData $version = $AzMetaData.ModuleVersion Write-Output "Az version: "$version" retrieved, from Az.psd1" -$Date = date -u +'%Y-%m-%dT%H:%M:%SZ' +$date = date -u +'%Y-%m-%dT%H:%M:%SZ' try { foreach ($dockerfile in (Get-ChildItem -Path $DOCKER -Filter "Dockerfile-*").FullName) { @@ -30,13 +30,13 @@ try { Write-Output $os if ($os -eq "ubuntu-18.04") { docker build --build-arg VERSION=$version ` - --build-arg BUILD_DATE=$Date ` + --build-arg BUILD_DATE=$date ` --tag $DockerImageName':'$version"-"$os ` --tag $DockerImageName':latest' ` -f $dockerfile $DOCKER }else { docker build --build-arg VERSION=$version ` - --build-arg BUILD_DATE=$Date ` + --build-arg BUILD_DATE=$date ` --tag $DockerImageName':'$version"-"$os ` -f $dockerfile $DOCKER } @@ -45,4 +45,4 @@ try { } catch { $Errors = $_ Write-Error ($Errors | Out-String) -} \ No newline at end of file +}