LoginSignup
2
2

More than 1 year has passed since last update.

Microsoft Artifact Registry (mcr.microsoft.com) にあるコンテナーイメージのタグ一覧を確認する

Posted at

背景と目的

Docker Hub はいつからかダウンロードレート制限をするようになり、検証時などで頻繁にプル要求をするような場合にダウンロードできなくなる事象が発生します。このような背景もあり Docker Hub からダウンロードせずに済むようクラウド事業者側で Docker Hub の代替環境となる Microsoft Artifact Registry (mcr.microsoft.com) などのパブリックなコンテナーレジストリを用意するようになりました。マイクロソフトのドキュメントを読んでいると、mcr.microsoft.com からプルする例を沢山見るようになったのですが、Docker Hub のようにコンテナーイメージのタグ一覧を表示するページがないものがあります。そこで簡単ではありますが、Microsoft Artifact Registry (mcr.microsoft.com) にあるコンテナーイメージのタグ一覧を確認する方法を探してみました。

マイクロソフトのドキュメント内にあるコンテナーイメージ名を確認

例えば、こちらのページの一番下に書いてある mcr.microsoft.com/dotnet/sdk:6.0docker pull する例を考えます。

コンテナーイメージをダウンロード

下記のように mcr.microsoft.com/dotnet/sdk というコンテナーイメージ名と 6.0 というタグ名でダウンロードします。

bash
$ docker pull mcr.microsoft.com/dotnet/sdk:6.0
6.0: Pulling from dotnet/sdk
f3ac85625e76: Pull complete 
73ad7fd25453: Pull complete 
9a180599f1e7: Pull complete 
ad9458d67ffc: Pull complete 
31a3331c9d7c: Pull complete 
d48d142e9b3c: Pull complete 
b97ae965b8dd: Pull complete 
b69cef364179: Pull complete 
Digest: sha256:3dfedfc30f95c93c3e1d41a2d376f4d3d6fef665888859b616c3b46dde695b73
Status: Downloaded newer image for mcr.microsoft.com/dotnet/sdk:6.0
mcr.microsoft.com/dotnet/sdk:6.0

イメージサイズを確認すると 756MB でした。

bash
$ docker images mcr.microsoft.com/dotnet/sdk:6.0
REPOSITORY                     TAG       IMAGE ID       CREATED       SIZE
mcr.microsoft.com/dotnet/sdk   6.0       a4c859a71885   10 days ago   756MB

ここで「もっとサイズの小さいコンテナーイメージがあるのではないか?」とか「他にどんなタグのコンテナーイメージがあるんだろう?」と疑問に思います。

ブラウザでタグの一覧を確認

こちらのページで Filter に 6.0 を入力します。

mcr-microsoft-com-01.png

スクショには含まれていませんが、ページ下の方にはよりコンテナーイメージのサイズが小さい 6.0-alpine というタグを見つけることができました。

bash
$ docker pull mcr.microsoft.com/dotnet/sdk:6.0-alpine
6.0-alpine: Pulling from dotnet/sdk
6875df1f5354: Pull complete 
bbe002ca839e: Pull complete 
e9fd4314b4af: Pull complete 
24625c6fe6e8: Pull complete 
2aa18253d0d2: Pull complete 
2cecdb1fdf2d: Pull complete 
Digest: sha256:206e5e725e035358ad40dc23461b048948d0b5c020940d5b54949921ebb2fe53
Status: Downloaded newer image for mcr.microsoft.com/dotnet/sdk:6.0-alpine
mcr.microsoft.com/dotnet/sdk:6.0-alpine

$ docker images mcr.microsoft.com/dotnet/sdk:6.0-alpine
REPOSITORY                     TAG          IMAGE ID       CREATED       SIZE
mcr.microsoft.com/dotnet/sdk   6.0-alpine   1cd0b4b1417a   13 days ago   594MB

本題のタグ一覧を表示するページがないコンテナーイメージ

例えば、こちらのページにある mcr.microsoft.com/azuredocs/aci-helloworld というコンテナーイメージは、Microsoft Artifact Registry (mcr.microsoft.com) をブラウザで探しても該当ページがありません。

mcr-microsoft-com-02.jpeg

本題のタグ一覧を表示するページがない場合の探し方

対象のコンテナーイメージ名を URL に置き換えてアクセスします。ブラウザでも表示可能です。

https://mcr.microsoft.com/v2/{コンテナーイメージ名}/tags/list

bash
$ curl https://mcr.microsoft.com/v2/azuredocs/aci-helloworld/tags/list
{
  "name": "azuredocs/aci-helloworld",
  "tags": [
    "latest",
    "windows"
  ]
}

latestwindows タグがあるのが確認できます。

おまけ、コンテナーイメージのマニフェストからアーキテクチャを確認したい場合

https://mcr.microsoft.com/v2/{コンテナーイメージ名}/manifests/{タグ名}

bash
$ curl -s https://mcr.microsoft.com/v2/azuredocs/aci-helloworld/manifests/latest | jq .architecture
"amd64"

$ curl -s https://mcr.microsoft.com/v2/dotnet/sdk/manifests/6.0-alpine | jq .architecture
"amd64"

$ curl -s https://mcr.microsoft.com/v2/dotnet/sdk/manifests/6.0-alpine-arm64v8 | jq .architecture
"arm64"

おまけ、GitHub Codespaces で使われるコンテナーイメージの場合

例えば、こちらのサンプルのように mcr.microsoft.com/devcontainers/universal:2 が使われている場合です。

bash
$ curl https://mcr.microsoft.com/v2/devcontainers/universal/tags/list
{
  "name": "devcontainers/universal",
  "tags": [
    "2",
    "2-focal",
    "2-linux",
    "2.0",
    "2.0-focal",
    "2.0-linux",
    "2.0.0",
    "2.0.0-focal",
    "2.0.0-linux",
    "2.0.10",
    "2.0.10-focal",
    "2.0.10-linux",
    "2.0.11",
    "2.0.11-focal",
    "2.0.11-linux",
    "2.0.12",
    "2.0.12-focal",
    "2.0.12-linux",
    "2.0.13",
    "2.0.13-focal",
    "2.0.13-linux",
    "2.0.14",
    "2.0.14-focal",
    "2.0.14-linux",
    "2.0.15",
    "2.0.15-focal",
    "2.0.15-linux",
    "2.0.16",
    "2.0.16-focal",
    "2.0.16-linux",
    "2.0.17",
    "2.0.17-focal",
    "2.0.17-linux",
    "2.0.18",
    "2.0.18-focal",
    "2.0.18-linux",
    "2.0.19",
    "2.0.19-focal",
    "2.0.19-linux",
    "2.0.20",
    "2.0.20-focal",
    "2.0.20-linux",
    "2.0.21",
    "2.0.21-focal",
    "2.0.21-linux",
    "2.0.22",
    "2.0.22-focal",
    "2.0.22-linux",
    "2.0.23",
    "2.0.23-focal",
    "2.0.23-linux",
    "2.0.24",
    "2.0.24-focal",
    "2.0.24-linux",
    "2.0.6",
    "2.0.6-focal",
    "2.0.6-linux",
    "2.0.7",
    "2.0.7-focal",
    "2.0.7-linux",
    "2.0.8",
    "2.0.8-focal",
    "2.0.8-linux",
    "2.0.9",
    "2.0.9-focal",
    "2.0.9-linux",
    "2.1",
    "2.1-focal",
    "2.1-linux",
    "2.1.0",
    "2.1.0-focal",
    "2.1.0-linux",
    "dev",
    "dev-focal",
    "dev-linux",
    "focal",
    "latest",
    "linux"
  ]
}

$ curl -s https://mcr.microsoft.com/v2/devcontainers/universal/manifests/2 | jq .architecture
"amd64"

参考

2
2
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
2
2