Skip to content

Commit

Permalink
adding security example
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel van Gils committed Oct 17, 2016
1 parent 4efdea1 commit f0a3542
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build:
version: 2016-02-13 // version of the build schema.
version: 2016-02-14 // version of the build schema.
steps:
- builder:
name: builder
Expand Down
12 changes: 12 additions & 0 deletions examples/security/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu
RUN apt-get update && apt-get install -y wget openssh-client

# add the authorized host key for github (avoids "Host key verification failed")
RUN mkdir ~/.ssh && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts

ARG host
ENV PRIVATE_KEY /root/.ssh/id_rsa
RUN wget -O $PRIVATE_KEY http://$host:8080/v1/secrets/file/id_rsa \
&& chmod 0600 $PRIVATE_KEY \
&& ssh -T [email protected] \
&& rm $PRIVATE_KEY
2 changes: 2 additions & 0 deletions examples/security/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Run this example using secrets
`habitus -env host=[ip of habitus endpoint] --host unix:///var/run/docker.sock --binding=0.0.0.0`
10 changes: 10 additions & 0 deletions examples/security/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build:
version: 2016-03-14
steps:
builder:
name: builder
dockerfile: Dockerfile
secrets:
id_rsa:
type: file
value: _env(HOME)/.ssh/id_rsa

0 comments on commit f0a3542

Please sign in to comment.