如何使用docker desktop 下载x86、amd64、arm64 镜像?

朴灿烈づ我的快乐病毒、 2022-09-12 14:56 578阅读 0赞

如何使用docker desktop 下载x86、amd64、arm64 镜像?

  • 环境
  • 修改配置
  • 重启docker后下载镜像
  • 验证镜像架构

环境

在这里插入图片描述

修改配置

官网地址,开启 Docker CLI 的实验特性
docker desktop 的Preferences=>>Docker Engine
experimental 的值设置成 true,意思是:开启manifest实验特性

  1. {
  2. "registry-mirrors": [
  3. "https://registry.cn-hangzhou.aliyuncs.com"
  4. ],
  5. "insecure-registries": [
  6. "0.0.0.0/0",
  7. "dockerhub.kubesphere.local:443"
  8. ],
  9. "debug": true,
  10. "experimental": true
  11. }

重启docker后下载镜像

–platform=arm64指定CPU平台架构的镜像

  1. ~ docker pull --platform=arm64 nginx:latest
  2. latest: Pulling from library/nginx
  3. d10c227306ce: Pull complete
  4. 6d7f45405386: Pull complete
  5. 1b5147f94884: Pull complete
  6. 52ae3a597441: Pull complete
  7. 3ce50094efa7: Pull complete
  8. 7bf647869efa: Pull complete
  9. Digest: sha256:853b221d3341add7aaadf5f81dd088ea943ab9c918766e295321294b035f3f3e
  10. Status: Downloaded newer image for nginx:latest
  11. docker.io/library/nginx:latest

验证镜像架构

docker manifest inspect —insecure nginx:latest

  1. ~ docker manifest inspect --insecure nginx:latest
  2. ^[{
  3. "schemaVersion": 2,
  4. "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  5. "manifests": [
  6. {
  7. "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  8. "size": 1570,
  9. "digest": "sha256:6fe11397c34b973f3c957f0da22b09b7f11a4802e1db47aef54c29e2813cc125",
  10. "platform": {
  11. "architecture": "amd64",
  12. "os": "linux"
  13. }
  14. },
  15. {
  16. "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  17. "size": 1570,
  18. "digest": "sha256:f6d65972ac54772c5f6b952e396aad3e516fcb250cd5825b98a33a82286c91c2",
  19. "platform": {
  20. "architecture": "arm",
  21. "os": "linux",
  22. "variant": "v5"
  23. }
  24. },
  25. {
  26. "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  27. "size": 1570,
  28. "digest": "sha256:8f4514d178b1f178fa04a5307695a7477af68bf95e78ec0ec6172a7ab06c30a2",
  29. "platform": {
  30. "architecture": "arm",
  31. "os": "linux",
  32. "variant": "v7"
  33. }
  34. },
  35. {
  36. "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  37. "size": 1570,
  38. "digest": "sha256:f68304ec388f969b0929d695a05a36ecdb3665009258631cb898ba046963e72a",
  39. "platform": {
  40. "architecture": "arm64",
  41. "os": "linux",
  42. "variant": "v8"
  43. }
  44. },
  45. {
  46. "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  47. "size": 1570,
  48. "digest": "sha256:0b5b438edb8be60c445a89a4c9043681ea16ef1cfcc0e9c168c059d76fb8e04e",
  49. "platform": {
  50. "architecture": "386",
  51. "os": "linux"
  52. }
  53. },
  54. {
  55. "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  56. "size": 1570,
  57. "digest": "sha256:3e0cbe127ddfb82dde1e6c150199cfdfdc35c6a4a3cb7b7ff5f8c09e47df00be",
  58. "platform": {
  59. "architecture": "mips64le",
  60. "os": "linux"
  61. }
  62. },
  63. {
  64. "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  65. "size": 1570,
  66. "digest": "sha256:2472887e70008a6ed87a004c5c70e5fbc6e2e47aeac3d76d149669a4119f4bd6",
  67. "platform": {
  68. "architecture": "ppc64le",
  69. "os": "linux"
  70. }
  71. },
  72. {
  73. "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  74. "size": 1570,
  75. "digest": "sha256:ef218d58b531ffaf0702b4d8f14501e6d84b25efe384171eb0e839a2f662e676",
  76. "platform": {
  77. "architecture": "s390x",
  78. "os": "linux"
  79. }
  80. }
  81. ]
  82. }

参考文章

发表评论

表情:
评论列表 (有 0 条评论,578人围观)

还没有评论,来说两句吧...

相关阅读

    相关 X86X86_64AMD64的由来

    为什么叫X86和X86\_64和AMD64 为什么大家叫x86为32位系统呢 相信大家在大学里面有很多人都玩过8086(微处理器),这是一个可编程的系统,他是由intel