Skip to content

Commit c123197

Browse files
committed
add timestamp to docker image
1 parent 4df6b4c commit c123197

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

docker/Dockerfile-centos-7

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ ARG CONFIG=config
88
ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json
99
ARG AZURE=/root/.Azure
1010
ARG VCS_REF="none"
11+
ARG Build_Date=
1112
ARG VERSION=
1213
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-centos-7
1314

1415
LABEL maintainer="Azure PowerShell Team <[email protected]>" \
1516
readme.md="http://aka.ms/azpsdockerreadme" \
1617
description="This Dockerfile will install the latest release of Azure PowerShell." \
18+
org.label-schema.build-date=${Build_Date} \
1719
org.label-schema.usage="http://aka.ms/azpsdocker" \
1820
org.label-schema.url="http://aka.ms/azpsdockerreadme" \
1921
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \

docker/Dockerfile-debian-9

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ ARG CONFIG=config
88
ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json
99
ARG AZURE=/root/.Azure
1010
ARG VCS_REF="none"
11+
ARG Build_Date=
1112
ARG VERSION=
1213
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-debian-9
1314

1415
LABEL maintainer="Azure PowerShell Team <[email protected]>" \
1516
readme.md="http://aka.ms/azpsdockerreadme" \
1617
description="This Dockerfile will install the latest release of Azure PowerShell." \
18+
org.label-schema.build-date=${Build_Date} \
1719
org.label-schema.usage="http://aka.ms/azpsdocker" \
1820
org.label-schema.url="http://aka.ms/azpsdockerreadme" \
1921
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \

docker/Dockerfile-ubuntu-18.04

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ ARG CONFIG=config
88
ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json
99
ARG AZURE=/root/.Azure
1010
ARG VCS_REF="none"
11+
ARG Build_Date=
1112
ARG VERSION=
1213
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-ubuntu-18.04
1314

1415
LABEL maintainer="Azure PowerShell Team <[email protected]>" \
1516
readme.md="http://aka.ms/azpsdockerreadme" \
1617
description="This Dockerfile will install the latest release of Azure PowerShell." \
18+
org.label-schema.build-date=${Build_Date} \
1719
org.label-schema.usage="http://aka.ms/azpsdocker" \
1820
org.label-schema.url="http://aka.ms/azpsdockerreadme" \
1921
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \

tools/docker/BuildImages.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ try {
2525
foreach ($dockerfile in (Get-ChildItem -Path $DOCKER -Filter "Dockerfile-*").FullName) {
2626
$os = $dockerfile.split("Dockerfile-")[1]
2727
Write-Output $os
28-
docker build --build-arg VERSION=$version -t $DockerImageName':'$version"-"$os -f $dockerfile $DOCKER
28+
docker build --build-arg VERSION=$version --build-arg BUILD_DATE="date -u +'%Y-%m-%dT%H:%M:%SZ'" \
29+
-t $DockerImageName':'$version"-"$os -f $dockerfile $DOCKER
2930
}
3031
} catch {
3132
$Errors = $_
32-
Write-Error ($_ | Out-String)
33+
Write-Error ($Errors | Out-String)
3334
}

0 commit comments

Comments
 (0)