forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to create a container manifest (PowerShell#6735)
Add script to create a container manifest
- Loading branch information
1 parent
ffa7e4b
commit 768cfc4
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Used to create a container manifest. | ||
# Prereq: you must login to $ContainerRegistery before running this script | ||
# default scenarios is to build a `latest` tag which will point to the `ubuntu-16.04` tag for linux | ||
# and the `windowsservercore` tag for windows | ||
param( | ||
[parameter(Mandatory)] | ||
[string] | ||
$ContainerRegistry, | ||
|
||
[ValidateNotNullOrEmpty()] | ||
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')] | ||
[string] | ||
$ManifestTag = 'latest', | ||
|
||
[ValidateNotNullOrEmpty()] | ||
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')] | ||
[string] | ||
$Image = 'powershell', | ||
|
||
[ValidateNotNullOrEmpty()] | ||
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')] | ||
[string[]] | ||
$TagList = ('ubuntu-16.04', 'windowsservercore') | ||
) | ||
|
||
$manifestList = @() | ||
foreach($tag in $TagList) | ||
{ | ||
$manifestList += "$ContainerRegistry/${Image}:$tag" | ||
} | ||
|
||
# Create the manifest | ||
docker manifest create $ContainerRegistry/${Image}:$ManifestTag $manifestList | ||
|
||
# Inspect (print) the manifest | ||
docker manifest inspect $ContainerRegistry/${Image}:$ManifestTag | ||
|
||
# push the manifest | ||
docker manifest push $ContainerRegistry/${Image}:$ManifestTag |