cloud66-oss/habitus

Docker for Mac - What should $host be?

dieswaytoofast opened this issue · 1 comments

I'm running Docker for Mac (straight - no VirtualBox).
What is the IP address that should get used from within the docker build process to get at habitus?

I've tried passing in the following to no avail (barfs with Connection refused)
a) --binding=127.0.0.1 --build host=127.0.0.1
b) --binding=$(ipconfig getifaddr en0) --build host=$(ipconfig getifaddr en0) ($(ipconfig getifaddr en0) resolves to 192.168.11.6)
c) Adding a new addr to lo0 via sudo ifconfig lo0 alias 10.200.10.1/24, and then --binding=10.200.10.1 --build host=10.200.10.1
d) Various combinations of the above

version

$ habitus --version
Habitus - v0.4.10 (c) 2016 Cloud 66 Inc.

habitus command (with the --binding=0.0.0.0 --build host=192.168.11.6 part replaced per the above)

sudo habitus --use-tls=false --host=unix:///var/run/docker.sock --binding=0.0.0.0 --build host=192.168.11.6 --port 8080 

build.yaml

build:
  version: 2016-03-14 # version of the build schema.
  steps:
    builder:
      name: builder
      dockerfile: Dockerfile
      secrets:
          id_rsa:
            type: file
            value: _env(HOME)/.ssh/id_rsa
      cleanup:
        commands:
          - rm -rf /root/.ssh/

Dockerfile

FROM ubuntu

ARG host
RUN curl -vvv http://$host:8080/v1/secrets/file/id_rsa

EDIT:
FWIW, i've run a web-server on 192.168.11.6, and successfully accessed it via docker build (i passed in the ip/port via habitus --build host=192.168.11.6 --port 8888

EDIT2:
If i change the dockerfile to access a different IP address (e.g. curl -vvv 192.168.11.100:8080), it just hangs trying to connect. This is with --binding=0.0.0.0 --build host=192.168.11.6. Changing ports doesn't make a difference

And, the answer is --secrets=true if using secrets (hat-tip #66)

For posterity, the args are --build host=$(ipconfig getifaddr en0) --host unix:///var/run/docker.sock --binding=$(ipconfig getifaddr en0) --secrets=true