Skip to content
This repository was archived by the owner on Jun 13, 2019. It is now read-only.
This repository was archived by the owner on Jun 13, 2019. It is now read-only.

Provide SSH key securely to the docker build #17

@tlvenn

Description

@tlvenn

Right now unless I am missing something, there is no easy or safe way to provide an ssh key to the docker build so that dependencies that are pulled with ssh would be resolved properly.

Reading on http://blog.cloud66.com/using-ssh-private-keys-securely-in-docker-build and how Habitus is solving this elegantly, I believe their solution is best and should be relatively simple to implement.

The idea is to open a web server on the docker network to expose the ssh key or any other secrets that the Dockerfile could fetch and once used, delete it, all in one transaction, leaving no trace behind whatsoever.

RUN wget -O ~/.ssh/id_rsa http://192.168.99.1:8080/secrets/file/id_rsa && mix do deps.get, deps.compile && rm ~/.ssh/id_rsa

We should also add github as an known host automatically:

# Adding github to known hosts
RUN mkdir ~/.ssh && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts

What do you think @teamon ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions