Search

Search IconIcon to open search

Architecture type (linux/amd64 and arm64)

Last updatedUpdated: by Simon Späti · CreatedCreated: · 3 min read

# Architecture types

  • arm64 –> arm64 (apple mac chips)
  • x86_64 –> amd64 (intel 64 bit CPU)
  • i386 –> 32 bit

# MacOS arch type i386 Rosetta

Install Rosetta on MacOS:
softwareupdate --install-rosetta --agree-to-license

To test:

  • Click to Open the Terminal, type arch to verify it says i386 or x86_64 (?) now.
    • on M1 Apple silicon it says arm64

Switch zsh to arm64 manually

1
env /usr/bin/arch -arm64 /opt/homebrew/bin/zsh --login

I added this to alias to easily switch:

1
2
alias arm="env /usr/bin/arch -arm64 /opt/homebrew/bin/zsh --login"
alias intel="env /usr/bin/arch -x86_64 /bin/zsh --login"

Good read M1 Mac — How to switch the Terminal between x86_64 and arm64.

# activate Rosetta on any app

Right-click any app > Get Info > Enable Open using Rosetta

For the terminal, check the above arch type to be correct.

# emulation amd64 vs arm64

When you run a Docker image designed for linux/amd64 on a macOS system with linux/arm64 architecture, Docker utilizes a process called “emulation”. This is achieved through Docker’s use of QEMU, an open-source machine emulator and virtualizer.

This emulation layer allows Docker to interpret and execute the AMD64 instructions on your ARM64 architecture, enabling cross-platform compatibility. However, it’s important to note that while emulation makes it possible to run images across different architectures, it can lead to reduced performance compared to running an image natively on the same architecture.

# Check Dockerimage architecture

# docker manifest inspect

tags on dockerhub Docker:

how to check with comand:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
docker pull nginx:stable-perl
docker manifest inspect nginx:stable-perl | jq '.manifests[].platform'
{
  "architecture": "amd64",
  "os": "linux"
}
{
  "architecture": "unknown",
  "os": "unknown"
}
{
  "architecture": "arm",
  "os": "linux",
  "variant": "v5"
}
{
  "architecture": "unknown",
  "os": "unknown"
}
{
  "architecture": "arm",
  "os": "linux",
  "variant": "v7"
}
{
  "architecture": "unknown",
  "os": "unknown"
}
{
  "architecture": "arm64",
  "os": "linux",
  "variant": "v8"
}
{
  "architecture": "386",
  "os": "linux"
}
{
  "architecture": "unknown",
  "os": "unknown"
}
{
  "architecture": "mips64le",
  "os": "linux"
}
{
  "architecture": "ppc64le",
  "os": "linux"
}
{
  "architecture": "unknown",
  "os": "unknown"
}
{
  "architecture": "s390x",
  "os": "linux"
}
{
  "architecture": "unknown",
  "os": "unknown"
}

# docker image inspect

Has my mac arch:

1
2
3
4
docker pull nginx:stable-perl
docker image inspect nginx:stable-perl --format '{{.Architecture}}'

arm64

Has not been uploaded with arm64 arch:

1
2
3
docker image inspect artifacts.bedag.cloud/bedag-nexus/se_gf_sie/hello-data-portal-api:latest  --format '{{.Architecture}}'

amd64

Origin: homebrew - On Apple M1 with Rosetta, how to open entire Terminal / iTerm in x86_64 architecture? - Ask Different