Created
September 28, 2021 04:23
-
-
Save kkamegawa/6d503dcefb5e1b67d289537d4435e8e7 to your computer and use it in GitHub Desktop.
Get latest buildx plugin from GitHub.
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
$latestRelease = Invoke-WebRequest https://github.com/docker/buildx/releases/latest -Headers @{"Accept"="application/json"} | |
$json = $latestRelease.content | ConvertFrom-Json | |
$latestVersion = $json.tag_name | |
$outputFolder = [environment]::GetFolderPath('UserProfile') | Join-Path -ChildPath '.docker' | Join-Path -ChildPath 'cli-plugins' | |
new-item -ItemType Directory -Path $outputFolder -Force | |
$outputPath = Join-Path $outputFolder -ChildPath 'docker-buildx.exe' | |
$url = "https://github.com/docker/buildx/releases/download/$latestVersion/buildx-$latestVersion.windows-amd64.exe" | |
Invoke-WebRequest $url -OutFile $outputPath | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment