Comments (14)
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.
I noticed the following issues:
- There is no
api
in the URL for the Secrets. Alsofile
is missing in the path. The correct URL for retrieving the secret should behttp://$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 amkdir -p ~/.ssh
as well as making suressh
is available on the image (alpine might not have it)
from habitus.
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.
Thank you for the note, updated.
Question: are you using the new Docker for mac?
from habitus.
No, this is just the standard boot2docker
from habitus.
@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.
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.
The example is here - https://github.com/katacoda/docker-build-arg-security-example/tree/master/habitus
from habitus.
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:
from habitus.
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.
Sorry @BenHall but I'm not familiar with the environment. Did you manage to run it in Linux or OSX?
from habitus.
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.
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.
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)
- Habitus on Windows HOT 2
- ssh -T [email protected] error HOT 3
- Habitus Install script not updated HOT 1
- Cleaning Intermediate images & Flag "noprune-rmi" having no effect HOT 2
- Custom path for .dockerignore HOT 1
- Build for step opencv failed due to Invalid header type HOT 1
- Provide an Aarch64/Arm64 Linux release HOT 3
- Dockerfile.generated race with same Dockerfile and different build args HOT 3
- Remov e
- v1.0.5 does not run in docker:19.03.6 HOT 3
- [Feature Request] Ability to build dockerfile located inside sub-directories HOT 6
- Build tend to fail due to DOCKER_TLS_VERIFY=1 not respected by habitus HOT 1
- Failing Codeship build HOT 5
- [Feature Request] Setting habitus' args from within build.yml HOT 3
- [Feature request] Support for docker's multi-stage build HOT 2
- Add unit tests HOT 1
- Feature request: Containerized secret server for more accessibility
- doc: Basic usage guide for minikube users
- Dependency management? HOT 1
- Switch to the official docker client HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from habitus.