1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Azure Container Registry への docker login ワンライナー (PowerShell版)

Last updated at Posted at 2020-03-12

ネット上にあるのがBash版ばかりなのでPowerShell版を参考に投下します。テスト的に使ってください。

環境

コマンド

AzureContainerRegistry_DockerLoginOneLiner_PowerShell
PS C:\> Get-AzContainerRegistryCredential -ResourceGroupName myresourcegroup -Name myregistry | Select-Object -ExpandProperty Password | docker login myregistry.azurecr.io --username myregistry --password-stdin 

Login Succeeded と表示されればログイン成功。
コマンド中の myresourcegroup myregistry は自身の環境に合わせること。

コマンド解説

  • Get-AzContainerRegistryCredential でAzure Container Registryのクレデンシャル情報を取得
  • 取得したクレデンシャル情報のうち Password の値のみを Select-Object -ExpandProperty で取得
  • Password の値を標準入力で docker login--password-stdin に引き渡し

参考リンク

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?