Giter Club home page Giter Club logo

Comments (14)

khash avatar khash commented on May 28, 2024 1

Trying to run Habitus on Docker for Mac (native) you can use the following command:

./habitus_darwin_amd64 -f habitus.yaml --build host=10.0.0.40 --host unix:///var/run/docker.sock --binding=0.0.0.0

In which 10.0.0.40 is the private IP address of my mac. Alternatively you can run something like this:

./habitus_darwin_amd64 -f habitus.yaml --build host=$(ipconfig getifaddr en0) --host unix:///var/run/docker.sock --binding=0.0.0.0

from habitus.

khash avatar khash commented on May 28, 2024

@BenHall

I noticed the following issues:

  • There is no api in the URL for the Secrets. Also file is missing in the path. The correct URL for retrieving the secret should be http://$host:8080/v1/secrets/file/id_rsa, hence the 404 errors.
  • Once you fix this issue you will be able to see that id_rsa will be retrieved. However you will probably need a mkdir -p ~/.ssh as well as making sure ssh is available on the image (alpine might not have it)

from habitus.

BenHall avatar BenHall commented on May 28, 2024

Thanks for the update.

I got the URL from http://blog.cloud66.com/using-ssh-private-keys-securely-in-docker-build/ - Might be worth updating the post?

I changed the Dockerfile so the command is now

RUN TOKEN=$(curl http://$host:8080/v1/secrets/file/id_rsa) && echo 'ENV:' && env && echo 'TOKEN ENV' && echo $TOKEN && unset $TOKEN

However, it still cannot communicate with 192.168.99.1:8080 nor 192.168.99.100:8080. From my host I can curl 192.168.99.100:8080 and it works great.

from habitus.

khash avatar khash commented on May 28, 2024

Thank you for the note, updated.

Question: are you using the new Docker for mac?

from habitus.

BenHall avatar BenHall commented on May 28, 2024

No, this is just the standard boot2docker

from habitus.

khash avatar khash commented on May 28, 2024

@BenHall if you look at the result of your ifconfig you can see the IP you can use. It's usually 192.168.99.1

from habitus.

BenHall avatar BenHall commented on May 28, 2024

Sorry for the delay in getting back to you about this. It's still hanging when attempting to access 192.168.99.1.

./habitus_darwin_amd64 -f habitus.yaml --build host=192.168.99.1

from habitus.

BenHall avatar BenHall commented on May 28, 2024

The example is here - https://github.com/katacoda/docker-build-arg-security-example/tree/master/habitus

from habitus.

khash avatar khash commented on May 28, 2024

I just cloned the example repo you kindly provided and ran the exact command you have in your comments and it all worked. One thing I can think is that the IP of the docker you are running is not the same.

The best way to find the IP address is to check the network name for the docker VM in VBox and then find it with ifconfig command:

screen shot 2016-06-26 at 19 28 59

screen shot 2016-06-26 at 19 29 30

from habitus.

BenHall avatar BenHall commented on May 28, 2024

I'm still having trouble with this :(

Tried on Linux, well Katacoda and it still can't connect...

This is the environment I was using: https://www.katacoda.com/courses/docker/playground

./habitus_linux_amd64 -f habitus.yaml --use-tls=false --build host=172.18.0.2 --host tcp://docker:2345 --binding=0.0.0.0

from habitus.

khash avatar khash commented on May 28, 2024

Sorry @BenHall but I'm not familiar with the environment. Did you manage to run it in Linux or OSX?

from habitus.

BenHall avatar BenHall commented on May 28, 2024

Katacoda is just a hosted Docker instance. I can't seem to get it working on either OSX or Linux. I imagine it's my example :(

from habitus.

khash avatar khash commented on May 28, 2024

That is very strange. I can't really comment on running it on Katacoda since it might be blocking the port or not having the port mapping to allow a container connect back to the host but not being able to run it on OSX or Linux is not something I've seen before like this. Can you send me the details of your Linux setup please? (OS version, docker version, etc).

from habitus.

fintrader avatar fintrader commented on May 28, 2024

I was facing the same issue @BenHall and I realized it was because of ufw. My docker config has --iptables=false" to enable ufw rules. I had to enable all traffic for the docker0 interface (172.17.0.0/16) to port 8080. You can see your docker0 ipv4 address by doing ifconfig -a

so in Ubuntu 14.04 lts:

sudo ufw enable from 172.17.0.0/16 to any port 8080

@khash I think you may be right about blocking a port - or at least this was the case in my setup.

from habitus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.