Failed to start docker container on mac osx

446 Views Asked by At

I am trying in vain to Gluu Server in docker container on my macbook . Here are the instructions how to start Gluu Server Single Host . It fails with following error

pmac:single-host root# ./run_all.sh 
[I] Determining OS Type and Attempting to Gather External IP Address
Host is detected as Mac
Is this the correct external IP Address: 192.168.1.103 [Y/n]? Y
[I] Preparing cluster-wide config and secret
[I] Checking existing config in Consul
[W] Unable to get config in Consul; retrying ...
[W] Unable to get config in Consul; retrying ...
[W] Unable to get config in Consul; retrying ...
[W] Configuration not found in Consul
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: 
starting container process caused "process_linux.go:449: 
container init caused \"rootfs_linux.go:58: mounting \\\"/Users/peeyush/projects/community-edition-containers-4.0/examples/single-host/generate.json\\\" 
to rootfs \\\"/var/lib/docker/overlay2/b7c623d9c7347ee09d7bda4dee929b5eb3bbbceb9ff956843cd693fb7fa3cbf5/merged\\\" 
at \\\"/var/lib/docker/overlay2/b7c623d9c7347ee09d7bda4dee929b5eb3bbbceb9ff956843cd693fb7fa3cbf5/merged/app/db/generate.json\\\" 
caused \\\"open /var/lib/docker/overlay2/b7c623d9c7347ee09d7bda4dee929b5eb3bbbceb9ff956843cd693fb7fa3cbf5/merged/app/db/generate.json: 
permission denied\\\"\"": unknown.
2

There are 2 best solutions below

0
Gau Rav On

Try to run using sudo ./run_all.sh and let me know

0
Will On

For anyone else that arrives at this question using RHEL or Centos, I had the same issue with RHEL 7.3

Apparently In older RHEL kernel versions they deny creation of mount namespaces inside a user namspace because of an out-of-tree patch. apparently RHEL 7.5 will fix this.

I updated my OS to 7.9 and it resolved the issue:

Check for updates:

yum check-update

Update the system

yum update

And then reboot

reboot 

After this follow the instructions as documented running as sudo.