십자 Docker를 실행하려면 qemu를 복사할 필요가 없습니다.
/usr/bin/qemu-aarch64-static
.근데 이제 그거 필요 없어.
새로운 VM으로 실험 수행
이 기사의 VM을 사용하고 있습니다.
ubuntu@u01:~$ docker run -it arm64v8/ubuntu:20.04
Unable to find image 'arm64v8/ubuntu:20.04' locally
20.04: Pulling from arm64v8/ubuntu
d4ba87bb7858: Pull complete
Digest: sha256:ca83774d06420ceb4682ef73bd9cbbfc38a97a27e061b578547a6761206658b9
Status: Downloaded newer image for arm64v8/ubuntu:20.04
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested
standard_init_linux.go:228: exec user process caused: exec format error
다시 한 번 시도해 보세요.ubuntu@u01:~$ docker run -it arm64v8/ubuntu:20.04
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested
standard_init_linux.go:228: exec user process caused: exec format error
안 돼요.설치
qemu-user-static
.ubuntu@u01:~$ sudo apt install qemu-user-static
ubuntu@u01:~$ cat /proc/sys/fs/binfmt_misc/qemu-aarch64
enabled
interpreter /usr/bin/qemu-aarch64-static
flags: OCF
offset 0
magic 7f454c460201010000000000000000000200b700
mask ffffffffffffff00fffffffffffffffffeffffff
ubuntu@u01:~$ ls -l /usr/bin/qemu-aarch64-static
-rwxr-xr-x 1 root root 6638096 Feb 23 02:44 /usr/bin/qemu-aarch64-static
이제 한 번 더 도전한다.ubuntu@u01:~$ docker run -it arm64v8/ubuntu:20.04
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested
root@828bba0296b3:/#
이번에 시동이 걸렸어요.root@828bba0296b3:/# uname -a
Linux 828bba0296b3 5.4.0-109-generic #123-Ubuntu SMP Fri Apr 8 09:10:54 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
root@828bba0296b3:/#
다른 tty에서 다음 동작을 수행합니다통과
ubuntu@u01:~$ ps ax |grep [q]emu
14477 pts/0 Ssl+ 0:00 /usr/bin/qemu-aarch64-static /usr/bin/bash
/usr/bin/qemu-aarch64-static
집행/usr/bin/bash
.binfmt_misc
F - fix binary
The usual behaviour of binfmt_misc is to spawn the binary lazily when the misc format file is invoked. However, this doesn’t work very well in the face of mount namespaces and changeroots, so the F mode opens the binary as soon as the emulation is installed and uses the opened image to spawn the emulator, meaning it is always available once installed, regardless of how the environment changes.
설치할 때interpreter를 열고 준비하기 때문에chroot에 걸려도 괜찮습니다.언제부터 이렇게 됐죠?참고로 이번 내핵 판본은 아래와 같다.
ubuntu@u01:~$ cat /proc/version
Linux version 5.4.0-109-generic (buildd@ubuntu) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #123-Ubuntu SMP Fri Apr 8 09:10:54 UTC 2022
연관성
arm64 Linux로 모모 강제 구축
Reference
이 문제에 관하여(십자 Docker를 실행하려면 qemu를 복사할 필요가 없습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/tetsu_koba/articles/b9545eb0231d7e텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)