Skip to content

Instantly share code, notes, and snippets.

@kkamegawa
Created September 28, 2021 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkamegawa/6d503dcefb5e1b67d289537d4435e8e7 to your computer and use it in GitHub Desktop.
Save kkamegawa/6d503dcefb5e1b67d289537d4435e8e7 to your computer and use it in GitHub Desktop.
Get latest buildx plugin from GitHub.
$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