djmaze / armhf-ubuntu-docker

Ubuntu-Core images for armhf (ARMv7+) devices
59 stars 16 forks source link

exec format error #1

Closed ghost closed 9 years ago

ghost commented 9 years ago

Installed and updated Debian Jessie/Sid, then docker as per docker.com instructions.

root@debian:~# docker pull mazzolino/armhf-ubuntu
Pulling repository mazzolino/armhf-ubuntu
a82937bfa76a: Download complete
7dbf639c956c: Download complete
Status: Downloaded newer image for mazzolino/armhf-ubuntu:latest
root@debian:~# docker images
REPOSITORY               TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu                   latest              86ce37374f40        14 hours ago        192.7 MB
mazzolino/armhf-ubuntu   14.04               a82937bfa76a        8 weeks ago         291.5 MB
mazzolino/armhf-ubuntu   trusty              a82937bfa76a        8 weeks ago         291.5 MB
mazzolino/armhf-ubuntu   latest              a82937bfa76a        8 weeks ago         291.5 MB
root@debian:~# docker run -t -i mazzolino/armhf-ubuntu /bin/bash
exec format error2014/11/26 20:20:16 Error response from daemon: Cannot start container 
d79e715b7dfec32c208d83540170394fcb1cb1d74f4bfa9d46be23e0fced387d: exec format error

Environment info:

root@debian:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux jessie/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="https://bugs.debian.org/"
root@debian:~# uname -r
3.16.0-4-amd64
root@debian:~# docker version
Client version: 1.3.1
Client API version: 1.15
Go version (client): go1.3.2
Git commit (client): 4e9bbfa
OS/Arch (client): linux/amd64
Server version: 1.3.1
Server API version: 1.15
Go version (server): go1.3.2
Git commit (server): 4e9bbfa
djmaze commented 9 years ago

I am not sure you understood that this is an image just for the armhf architecture. In order to run it on your amd64 host (supposedly for building / testing purposes), you need to install qemu and set up emulation support.

ghost commented 9 years ago

I did understand but I had conflicts between various qemu packages (I don't remember what it was but it may have been qemu-user-static and binfmt-support (maybe related to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677529 ) and because I only read the instructions from the Docker Web site I didn't notice that this particular package had to be installed. Also I filed a bug for Docker over at Ubuntu because if the system doesn't have required packages it shouldn't accept to create containers of architecture it cannot run.

djmaze commented 9 years ago

As long as Docker and the Registry Hub does not yet officially support architectures other than amd64, what we are doing currently is partly a hack. What's more, I don't think Docker will officially support this cross-architecture emulation approach any time soon. So in my opinion, this shouldn't be considered a bug in Docker (nor in Ubuntu).

Also, I am not sure if there is a good general way to automatically detect an image's architecture. The best solution would be to add this as meta information to the image upon creation.

ghost commented 9 years ago

What's more, I don't think Docker will officially support this cross-architecture emulation approach any time soon

Well they claim they do, that's why I submitted a bug. For example, for LXC (I know it's different) in their docs they let you download and display installable templates (sudo lxc-create --template download --name u1 for armhf, i386 and amd64). Why aren't they filtering out things they can't support (or, why don't they check deps from lxc, since they know you shouldn't be able to run armhf containers if you don't have the required qemu package(s) installed)?

So in my opinion, this shouldn't be considered a bug in Docker (nor in Ubuntu).

Yes, I agree. I submitted a bug to Ubuntu because I was using that OS, but they'll probably have to take that upstream and decide what they're going to do about that.