How to use docker pull to pull container images of specific architecture amd64, arm64, aarch64

How to use docker pull to pull container images of specific architecture amd64, arm64, aarch64

About x86, x86_64, x64, amd64 and arm64, aarch64

X86 32-bit Intel’s processing habit ends with 86, such as 80186, 80286, 80386, so it is called X86 AMD64. When 64-bit 32-bit evolved to 64-bit, AMD first created a compatible X86 32-bit instruction set 64-bit processor X86-64 64-bit Intel designed IA-64, one step behind amd, and not compatible with X86 32-bit instruction set, which is relatively bleak, so Intel also adopted AMD64 later, but On this basis, it has been expanded and renamed as X86-64, so x86_64, x64, and AMD64 are basically the same thing. The current intel/amd desktop CPUs are basically x86_64 ARM, which is suitable for low-cost mobile communications. AArch64: 64-bit execution state AArch32: 32-bit execution state There are two execution states, suitable for 32-bit and 64-bit AArch64 64-bit independent from ARM-V8

open properties

By modifying the dockerd configuration file and reloading, you can enable the experimental properties of dockerd on the server. For the configuration file /etc/docker/daemon.json

Add "experimental": true.

The modified configuration file will look similar to the following:

{
    
    
  "experimental": true
}

After the modification is complete, reset the service with the following command:

systemctl daemon-reload
systemctl restart docker

Pull the image of the specified architecture

Specify the parameters when docker pull to complete the pulling of the specified architecture image. Take pulling the alpine image of the arm64 architecture as an example.

docker pull --platform linux/arm64 openjdk

Its schema information can be determined by the following command:

$ docker image inspect openjdk | grep Architecture
"Architecture": "arm64",

The architecture of the host is aarch64:

$ arch
aarch64

Guess you like

Origin blog.csdn.net/cml011/article/details/128729136