Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Native docker on Mac #26

Closed
sudhar99 opened this issue Sep 14, 2016 · 25 comments
Closed

Issue with Native docker on Mac #26

sudhar99 opened this issue Sep 14, 2016 · 25 comments

Comments

@sudhar99
Copy link

I am using native docker (1.12) on Mac. Had some volume mount issue in Sonar and opt directories. Resolved them thru "Preferences -> File Sharing". But now I am getting the following error

$ sudo docker-compose up -d
Password:
Removing dockercitoolstack_jenkins_1
dockercitoolstack_gitlab_1 is up-to-date
Starting dockercitoolstack_seleniumhub_1
Starting dockercitoolstack_sonardb_1
Starting dockercitoolstack_nexus_1
Starting dockercitoolstack_nodechrome_1
Starting dockercitoolstack_nodeff_1
Starting dockercitoolstack_sonar_1
Recreating e6bbf4cc74e7_e6bbf4cc74e7_dockercitoolstack_jenkins_1

ERROR: for jenkins Cannot start service jenkins: oci runtime error: rootfs_linux.go:53: mounting "/var/lib/docker/aufs/mnt/ee94f1a509f954c149105fef34ef5218cf27dea3ce16a3a9bdeee037b7a84f5e/usr/bin/docker" to rootfs "/var/lib/docker/aufs/mnt/ee94f1a509f954c149105fef34ef5218cf27dea3ce16a3a9bdeee037b7a84f5e" caused "not a directory"

@ethiclab
Copy link

Hello,

How does you docker-compose.yml look like? Are you using the original paths or have you changed them?

Edu.

@sudhar99
Copy link
Author

Just got the latest pull and didn't change anything in the yml or any other files. Ran under "sudo" mode thats all. Here is my command: sudo docker-compose up -d

@ethiclab
Copy link

Have you created the folders /opt/jenkins, /opt/postgres and /opt/gitlab ?

@ethiclab
Copy link

And, by the way, what beta build of version 1.12 are you using?

@sudhar99
Copy link
Author

Yes I did create (/opt/jenkins, /opt/postgres) because of previous issues. But I don't see /opt/gitlab in my Mac host? I am using the stable version and not the beta. Here is my version

Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: darwin/amd64

Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: linux/amd64

@ethiclab
Copy link

Have you added those directories to the docker's file sharing list?

docker-mac-gui-1

@sudhar99
Copy link
Author

Yes I did. Have all except gitlab directory. I think the root cause is somewhere else. When I look up, I don't see a directory /var/lib/docker on my host. Anyway I will create the gitlab directory/share and see.

@sudhar99
Copy link
Author

Interesting !!! When I created the subfolder gitlab under opt and tried to share in docker, got a error message saying "/opt/gitlab" is reserved for docker engine...

@ethiclab
Copy link

You should change the permission for those folders to your user, and by the way I think you should not use sudo.

@sudhar99
Copy link
Author

Anyway got the same error, when I re-ran the same command "docker-compose up -d" no sudo.
(after creating the gitlab sub-folder)

@ethiclab
Copy link

I can't replicate your error. I had the same problem some days ago, but right now it is working as expected! :/

jenkins-1

@sudhar99
Copy link
Author

What did you do to correct it? Though I have played with docker using virtual box before ( year back), never played on plain docker. Do u remember anything? How can I restart fresh install of the CI stack?

@ethiclab
Copy link

I just created folders within my own user folder: /Users/user/jenkins, etc and added /Users as shared filesystem to docker.

But finally I decided to make my own stack. Also because it seems that host mounted folders are not so portable according to docker documentation. If you want, have a look at it...

https://github.com/ethiclab/buildmachine

@ethiclab
Copy link

Otherwise, try the latest beta:

Version 1.12.1-beta26 (build: 12048)
d411b71fe748cb66845ccd3235ea5b60aaf71c72

I think they are playing a lot with this mac osx version right now.

@ethiclab
Copy link

ethiclab commented Sep 14, 2016

Oh! I remember now how I fixed it.

#24

I just followed the advice given about subsituting '/usr/local/bin/docker' for '/usr/bin/docker'

23:   - /usr/bin/docker:/usr/bin/docker

because if you notice, the error is the same but it's for some reason shown in a different way.

@sudhar99
Copy link
Author

Now I get a different error. Mount denied: /usr/bin/jenkin/
I think it is part of my new mac OS El Capiton OS. Here is the explanation..http://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really?newreg=068dc403fea74a3eb1e434b955924023

Can I mount to /Users?
/Users/bin/docker::/usr/bin/docker

@ethiclab
Copy link

/usr/bin/jenkin ? I think it is a typo. Could you please copy and paste your docker-compose.yml?

@sudhar99
Copy link
Author

Here is my modified docker-compose.yml.
jenkins:
build: ./jenkins
ports:
- "18080:8080"
networks:
- prodnetwork
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/jenkin/docker:/usr/bin/docker
- /opt/jenkins/:/var/lib/jenkins/

I am getting this error:
ERROR: for jenkins Cannot start service jenkins: Mounts denied:
The path /usr/bin/jenkin/docker
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

I am not able to "file share" /usr folder in docker preference because of my OS version ( i guess)..

@ethiclab
Copy link

there is a typo:

you should use:

 - /usr/bin/docker:/usr/bin/docker

and not:

 - /usr/bin/jenkin/docker:/usr/bin/docker

it does not make any sense.

@sudhar99
Copy link
Author

My fault. When specified
/usr/local/bin/docker:/usr/bin/docker

correctly, I didn't any error. Finally !!. Lets see if all the URLs are working

Thanks for all your help,
-Sudharsan.

@sudhar99
Copy link
Author

I was able to get all the URLs working. Thanks a lot and I can play with it more now. One last thing. How can I shutdown all the containers and bring it back?

@ethiclab
Copy link

well,

you can issue the following command:

docker-compose down

to restart just run again

docker-compose up -d

volumes are persistent.

@ethiclab
Copy link

Hello,

Please close this issue. I think you can since you opened it.

Thanks.

jonashackt added a commit to jonashackt/docker-ci-tool-stack that referenced this issue Sep 16, 2016
@TalentBE
Copy link

Had the same issue on my Mac - and below is how i resolved it.

After hours of googling and almost to the point of wanting to throw my Mac through the window the following worked for me .

I created a new folder ( mkdir name of folder and then open your Docker -> Preferences -> File Sharing and add the newly created directory - locate in the pc and add it in.

After that the Docker will restart and then viola!!!

PS - the error message always have the folder name it requires to proceed with the mount.
ERROR: for 'name' Cannot start service 'name': b'Mounts denied: \r\nThe path /certs\r\nis not shared from OS X and is not known to Docker.\r\nYou can configure shared paths from Docker -> Preferences... -> File Sharing.\r\nSee https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\r\n.'

Notice the following line - \r\nThe path /certs\r\nis not certs in this case is the folder thats being looked for - in your terminal you can do the following ( mkdir certs - certs being any folder name being required )

@87abhii
Copy link

87abhii commented Jan 27, 2019

certs

please can you explain more in detail!!!!
@TalentBE
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants