rancher: Failed to register the host with Rancher
Rancher Version: v1.1.3
Docker Version: v1.1.3
OS and where are the hosts located? (cloud, bare metal, etc): Mac OSX 10.11.6 Local machine
Setup Details: (single node rancher vs. HA rancher, internal DB vs. external DB) Single node rancher
Environment Type: (Cattle/Kubernetes/Swarm/Mesos) None. Just docker.
Steps to Reproduce:
- $ git clone https://github.com/rancher/rancher.git
- $ cd rancher
- $ docker run -d --restart=always -p 8080:8080 rancher/server
- Go to localhost:8080
- On “Adding your first host”, Click on Add Host
- On “Custom” tab, copy step 5:
sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.2 http://localhost:8080/v1/projects/1a5/scripts/0A8F9C5022B9E31A1B54:1473274800000:HP1iZa94EwdJMFCNYM5Erlw9ig
- Run it.
Results:
$ sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.2 http://localhost:8080/v1/scripts/313757F94E51711D2ACF:1473271200000:IItuw8awr69IebBZEIZr0wjeM8
Password:
Unable to find image 'rancher/agent:v1.0.2' locally
v1.0.2: Pulling from rancher/agent
5a132a7e7af1: Already exists
fd2731e4c50c: Already exists
28a2f68d1120: Already exists
a3ed95caeb02: Already exists
7fa4fac65171: Pull complete
33de63de5fdb: Pull complete
d00b3b942272: Pull complete
Digest: sha256:b0b532d1e891534779d0eb1a01a5717ebfff9ac024db4412ead87d834ba92544
Status: Downloaded newer image for rancher/agent:v1.0.2
963c83d344e5fb28fd826860e15bcf7d34674ec5815b432cb6037984cfbb4c6a
docker: Error response from daemon: Mounts denied:
The path /var/lib/rancher
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.
..
Expected: It should add a new host to Rancher
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 7
- Comments: 22 (2 by maintainers)
/var/lib/rancher
mount to-v /private/var/lib/rancher:/var/lib/rancher
andsudo mkdir -p /var/lib/rancher
/private/var/lib
to Docker -> Preferences… -> File SharingShould do the trick!
@robertcsakany Here are two things I did.
localhost
. Read Add Hosts why this should be done.-v /var/lib/rancher:/var/lib/rancher
to-v /repository_where_rancher_is_stored:/var/lib/rancher
@serv are u saying if i want to run a rancher agent on physical machine or virtual machine ,i need to clone the source code and point to this directory in the “sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.2 http://localhost:8080/v1/scripts/41378FF43526C55B72AD:1474819200000:qyh6fdvTlecx9ALCCU2M0FZVnyo”
@wanghaisheng Rancher source code that you cloned from this repo
@serv what do you mean by repository_where_rancher_is_stored ?rancher source code or mysql data ?