如何构buildmoby的ARM v7 Dockerfile?

在Dockercon 17期间, moby已经被正式宣布为docker核心项目的中心。

试图在Linux x86机器上使用他们的ARM参考Dockerfile来运行。

我跑这个设置qemu的arm:

$ wget https://github.com/multiarch/qemu-user-static/releases/download/v2.8.1/x86_64_qemu-arm-static.tar.gz $ tar -xvzf x86_64_qemu-arm-static.tar.gz # switch to binfmt $ update-binfmts --enable qemu-arm $ update-binfmts --display qemu-arm $ wget https://github.com/moby/moby/blob/master/Dockerfile.armhf 

然后编辑Dockerfile将qemu-arm bin COPY到容器中:

最后,我正在尝试构build容器:

 $ wget https://github.com/moby/moby/blob/master/Dockerfile.armhf $ docker build --no-cache=true -t "try-moby:arm-dev" -f "Dockerfile.armhf" . 

但它无法build立golint( fatal error: rt_sigaction failure ):

  ---> f573839c7252 Removing intermediate container 5b28bba3eafa Step 18 : RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint && (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) && go install -v github.com/golang/lint/golint ---> Running in 8ddeb9e036d6 Cloning into '/go/src/github.com/golang/lint'... fatal error: rt_sigaction failure runtime stack: runtime.throw(0x42dc33, 0x14) /usr/local/go/src/runtime/panic.go:566 +0x78 runtime.setsigstack(0x21) /usr/local/go/src/runtime/os_linux.go:426 +0xec runtime.initsig(0x5aab00) /usr/local/go/src/runtime/signal1_unix.go:78 +0x198 runtime.mstart1() /usr/local/go/src/runtime/proc.go:1122 +0xdc runtime.mstart() /usr/local/go/src/runtime/proc.go:1096 +0x84 goroutine 1 [runnable]: runtime.main() /usr/local/go/src/runtime/proc.go:106 runtime.goexit() /usr/local/go/src/runtime/asm_arm.s:998 +0x4 goroutine 17 [syscall, locked to thread]: runtime.goexit() /usr/local/go/src/runtime/asm_arm.s:998 +0x4 The command '/bin/sh -c git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint && (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) && go install -v github.com/golang/lint/golint' returned a non-zero code: 2 

作为一个健全的检查,我确信armhf-ubuntu:trusty作品:

 $ docker run --rm -it -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static ioft/armhf-ubuntu:trusty uname -a Linux 5bd2945d5f53 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 armv7l armv7l armv7l GNU/Linux