Error while running the 'docker run'

Issue type:
Docker run failing with below error

standard_init_linux.go:178: exec user process caused "no such file or directory"
OS Version/build:

docker info
Containers: 9
Running: 0
Paused: 0
Stopped: 9
Images: 8
Server Version: 17.03.1-ee-3
Storage Driver: overlay
Backing Filesystem: extfs
Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-514.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 125.7 GiB
Name: blr07
ID: KZGV:XDWK:DBVS:IXPW:OUH2:ZN3G:GEHB:P3WA:JJBO:HMDO:BYPV:SFYO
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: falseundefined> docker version
Client:
Version: 17.03.1-ee-3
API version: 1.27
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 20:03:25 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.1-ee-3
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 20:03:25 2017
OS/Arch: linux/amd64
Experimental: false
Steps to reproduce:

Complied basic hello-world programm
include
main()
{
printf(“Hello World”);

}
2. complied with below option

gcc -o hello hello-world.c
Build the image
docker build --tag hello .
Sending build context to Docker daemon 41.08 MB
Step 1/3 : FROM scratch
—>
Step 2/3 : ADD hello /
—> Using cache
—> 35c30b4b50c1
Step 3/3 : CMD /hello
—> Using cache
—> 7db9fed878ec
Successfully built 7db9fed878ec
run the image
docker run hello
standard_init_linux.go:178: exec user process caused "no such file or directory"
Here if i tried compliing the programm with - static option and run the image. I see a different error again.

docker build --tag hello .
Sending build context to Docker daemon 41.07 MB
Step 1/3 : FROM scratch
—>
Step 2/3 : ADD hello /
—> 8ca7398511dd
Removing intermediate container 8af1c8e3d249
Step 3/3 : CMD /hello
—> Running in 3892aa775229
—> d493faa52fd4
Removing intermediate container 3892aa775229
Successfully built d493faa52fd4

docker run --rm hello
standard_init_linux.go:178: exec user process caused “exec format error”

It seems your Dockerfile’s CMD is missing a dot. It should be ./hello instead of /hello:

CMD ./hello