rabbah commented on a change in pull request #1790: Make OW run with docker for mac URL: https://github.com/apache/incubator-openwhisk/pull/1790#discussion_r124284287
########## File path: ansible/README.md ########## @@ -17,40 +17,55 @@ Nothing to be done, Ansible is already installed during vagrant provisioning. You can skip setup and prereq steps as those have been done by vagrant for you. You may jump directly to [Deploying Using CouchDB](#deploying-using-couchdb) -#### Mac users -It is assumed that a VM has been provisioned using [Docker Machine](../tools/macos/README.md). - +#### Docker for Mac users +``` +sudo easy_install pip +sudo pip install ansible==2.3.0.0 ``` -brew install python -pip install ansible==2.3.0.0 +Docker for Mac does not provide any official ways to meet some requirements for OpenWhisk. +You need to depends on the workarounds until Docker provides official methods. -cd ansible -ansible-playbook -i environments/mac setup.yml [-e docker_machine_name=whisk] +If you prefer [Docker-machine](https://docs.docker.com/machine/) to [Docker for mac](https://docs.docker.com/docker-for-mac/), you can follow instructions in [docker-machine/README.md](../tools/macos/docker-machine/README.md) + +##### Enable docker remote API + +During the deployment steps, each component communicates with docker via docker remote API. +Currently however, Docker for Mac does not support such a feature. + +There are many workarounds for this. +One way is to use `socat` command to setup proxy for the unix socket. + +``` +docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 4243:2375 bobrik/socat TCP4-LISTEN:2375,fork,reuseaddr UNIX-CONNECT:/var/run/docker.sock ``` -**Hint:** If you omit the optional `-e docker_machine_name` parameter, it will default to "whisk". -If your docker-machine VM has a different name you may pass it via the `-e docker_machine_name` parameter. +If you want to deploy OpenWhisk in distributed environment, you are required to enable docker remote API in all Mac hosts. -After this there should be a `hosts` file in the `ansible/environments/mac` directory. +##### Activate docker0 network +This is an optional step for local deployment. +OpenWhisk Ansible script uses docker0 network interface to deploy OpenWhisk and it does not exist on Docker for Mac environment. -To verify the hosts file you can do a quick ping to the docker machine: +An expedient workaround is to add alias for docker0 network to loopback interface. Review comment: `docker0`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
