You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/06/28 21:54:37 UTC

[GitHub] markusthoemmes commented on a change in pull request #2440: Use docker API via unix-socket in /var/run/docker.sock

markusthoemmes commented on a change in pull request #2440: Use docker API via unix-socket in /var/run/docker.sock
URL: https://github.com/apache/incubator-openwhisk/pull/2440#discussion_r124666789
 
 

 ##########
 File path: ansible/roles/invoker/tasks/deploy.yml
 ##########
 @@ -23,9 +23,23 @@
   when: docker_registry != ""
   retries: 3
 
-- name: determine docker root dir
+- name: "determine docker root dir on docker-machine"
   uri:  url="http://{{ inventory_hostname }}:{{ docker.port }}/info" return_content=yes
-  register: dockerInfo
+  register: dockerInfo_output
+  when: "'environments/docker-machine' in inventory_dir"
+
+- set_fact:
+    dockerInfo: "{{ dockerInfo_output['json'] }}"
+  when: "'environments/docker-machine' in inventory_dir"
+
+- name: "determine docker root dir"
+  shell: curl --unix-socket /var/run/docker.sock http:/v1.24/info
+  register: dockerInfo_output
+  when: "'environments/docker-machine' not in inventory_dir"
+
+- set_fact:
+    dockerInfo: "{{ dockerInfo_output.stdout|from_json }}"
+  when: "'environments/docker-machine' not in inventory_dir"
 
 Review comment:
   This feels like a step back and it clutters  environmental differences even more. Can we somehow fold this into one setting? I.e.: docker_host for docker-machine would be: 192.168.99.100:4243 and for docker-on-mac it would be /var/run/docker.sock where you could detect that you try to use a socket or an IP which would at least remove the environment hard-coding. WDYT?
 
----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services