moby: Docker for Mac: standard_init_linux.go:175: exec user process caused "exec format error"
Output of docker version
:
$ docker version
Client:
Version: 1.12.0-rc2
API version: 1.24
Go version: go1.6.2
Git commit: 906eacd
Built: Fri Jun 17 20:35:33 2016
OS/Arch: darwin/amd64
Experimental: true
Server:
Version: 1.12.0-rc2
API version: 1.24
Go version: go1.6.2
Git commit: 906eacd
Built: Fri Jun 17 20:45:29 2016
OS/Arch: linux/amd64
Output of docker info
:
$ docker version
Client:
Version: 1.12.0-rc2
API version: 1.24
Go version: go1.6.2
Git commit: 906eacd
Built: Fri Jun 17 20:35:33 2016
OS/Arch: darwin/amd64
Experimental: true
Server:
Version: 1.12.0-rc2
API version: 1.24
Go version: go1.6.2
Git commit: 906eacd
Built: Fri Jun 17 20:45:29 2016
OS/Arch: linux/amd64
mdesales@Marcello-New2015 [06/22/201611:00:19] ~/dev/github/public/docker/example-voting-app (master *) $ docker info
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 28
Server Version: 1.12.0-rc2
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 65
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: overlay null bridge host
Swarm: inactive
Runtimes: default
Default Runtime: default
Security Options: seccomp
Kernel Version: 4.4.13-boot2docker
Operating System: Boot2Docker 1.12.0-rc2 (TCL 7.1); HEAD : 52952ef - Fri Jun 17 21:01:09 UTC 2016
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 995.9 MiB
Name: manager1
ID: UT7Z:UE6B:275T:AALD:N43H:WB45:7TJL:KUFH:IGGB:JEPS:SRGR:LV7L
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 51
Goroutines: 180
System Time: 2016-06-22T17:53:54.129259814Z
EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
provider=virtualbox
Insecure Registries:
127.0.0.0/8
Additional environment details (AWS, VirtualBox, physical, etc.):
Trying to run on the native Docker for Mac 10.11.5.
$ sw_vers -productVersion
10.11.5
$ docker run --rm -p 8083:8000 hypriot/rpi-whoami
standard_init_linux.go:175: exec user process caused "exec format error"
Steps to reproduce the issue:
- Install Docker for Mac
- Try to run a command that binds a port number
Describe the results you received:
The following error was printed:
standard_init_linux.go:175: exec user process caused "exec format error"
Describe the results you expected:
The process should be running…
Additional information you deem important (e.g. issue happens only occasionally):
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 31 (7 by maintainers)
Commits related to this issue
- add shebang line to skyfire script to fix 'standard_init_linux.go:178: exec user process caused "exec format error"' errors based on: https://github.com/moby/moby/issues/23865#issuecomment-245728942 — committed to blackducksoftware/perceptor-skyfire by mattfenwick 6 years ago
- fix: arm build from resin/rpi-raspian to support qemu binary per issue here https://github.com/moby/moby/issues/23865 — committed to rdkls/docker-aws-dashing by rdkls 6 years ago
I was able to resolve this error for my docker container by adding a Sha-Bang on top of the shell script that I was trying to run as CMD in dockerfile
#!/bin/bash
@tompscanlan I ran into this and realized I was building the go executable on my Mac and then trying to run it in an Ubuntu container. Updating the build command to the following fixed the issue.
Had this issue. Was the result of a noob space at the beginning of my entrypoint script
#!/bin/bash
You need to issue a shell command. Like
bash
at the end of the statement.I’m seeing the same symptom from packaging a go application
Besides OS X this also happens on Linux Mint 17.3 while running a static compiled Go binary in a Docker scratch container:
Yes we are planning to make it fully transparent in future. On 12 Jul 2016 00:05, “Marcello de Sales” notifications@github.com wrote:
Docker for Mac is able to run Raspberry Pi images (and others) if the image contains the qemu binary. The rpi-whoami is supposed to be a very small image lacking other binaries, so this does not work out of the box with Docker for Mac.
But try one of the resin/rpi-raspbian based images, these will work. Eg.
docker run --rm -it resin/rpi-raspbian uname -a
Maybe Docker for Mac magically mounts the qemu binary in the future into the container so that every image just works 😃
What will be the W/A for now? I’m running on 1.12 rc4-beta20 for MAC. See same symptoms.
@archyufa @perrohunter build from an image that supports qemu binary, such as the
resin/rpi-raspbian
based images mentioned above.Just encountered this issue as well. Ended up being a layer that wasn’t pulled properly. Running
docker system prune --all
and re-pulling the image fixed the issue.Why is this issue closed, it seems like folks are still hitting it.
Can someone clarify what the problem is?
I’m also hitting this on a Mac when building a go static binary and adding it FROM scratch to a docker container.
One of the reasons why this error could happen is
line endings
If you are on Windows, make sure that your custom
entrypoint
file usesLF
(Unix style) line endings, notCRLF
(Windows style line endings).It could happen if you created
entrypoint
file on Windows, or checked out it fromGit
repository on Windows (it converts line endings LF to CRLF by default on Windows).Same here…
Errors:
How did you compile the binary? If you compiled the binary on OS X, it may still be an invalid binary to run on Linux. What happens if you add that binary to a non-scratch image (e.g. alpine or ubuntu), and run the binary from an interactive shell?
@thaJeztah @StefanScherer I would be glad to have those suggestions… This should be transparent for Mac users having that Docker can run anything anywhere 😃