Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

updated at

x86_64のUbuntuでarm64のdockerイメージを動かす (クロスでdocker実行)


Ubuntu 18.04 を使用しています。

docker run を実行

$ docker run -it arm64v8/ubuntu:18.04
standard_init_linux.go:195: exec user process caused "no such file or directory"




$ docker ps -a
CONTAINER ID        IMAGE                  COMMAND             CREATED             STATUS                      PORTS               NAMES
388345ce4956        arm64v8/ubuntu:18.04   "/bin/bash"         19 minutes ago      Exited (0) 39 seconds ago                       goofy_agnesi

そのコンテナの中にqemu-aarch64-static をコピーする。これはx86_64の実行ファイル。

sudo apt install qemu-user-static
docker cp /usr/bin/qemu-aarch64-static 388345ce4956:/usr/bin/qemu-aarch64-static

コンテナをcommit してdocker image を作成

$ docker commit 388345ce4956 arm64v8/ubuntu:18.04_cross

docker run を実行


$ docker run -it arm64v8/ubuntu:18.04_cross
root@828eebd24c03:/# ls
bin   dev  home  media  opt   root  sbin  sys  usr
boot  etc  lib   mnt    proc  run   srv   tmp  var
root@828eebd24c03:/# uname -a
Linux 828eebd24c03 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
Help us understand the problem. What are the problem?