Adds a user public SSH key to the host's ~/.ssh/authorized_keys via docker container
Shell
Switch branches/tags
Nothing to show
Clone or download
Latest commit cfd202e Feb 26, 2016
Permalink
Failed to load latest commit information.
Dockerfile initial version Feb 25, 2016
LICENSE initial version Feb 25, 2016
README.md initial version Feb 25, 2016
docker-cloud.yml initial version Feb 25, 2016
run.sh initial version Feb 25, 2016
test.sh initial version Feb 25, 2016

README.md

authorizedkeys

Deploy to Docker Cloud

Adds a user public SSH key to the host's ~/.ssh/authorized_keys using a container

Usage

docker run -v /root:/user -e AUTHORIZED_KEYS="`cat ~/.ssh/id_rsa.pub`" dockercloud/authorizedkeys

With multiple keys:

docker run -v /root:/user -e AUTHORIZED_KEYS="`cat ~/.ssh/id_rsa1.pub`,`cat ~/.ssh/id_rsa2.pub`" dockercloud/authorizedkeys

Adding the key to a user different than root:

docker run -v /home/myuser:/user -e AUTHORIZED_KEYS="`cat ~/.ssh/id_rsa.pub`" dockercloud/authorizedkeys

Usage in Docker Cloud

We recommend using this image in Docker Cloud as follows:

authorizedkeys:
  image: dockercloud/authorizedkeys
  deployment_strategy: every_node
  autodestroy: always
  environment:
    - AUTHORIZED_KEYS=ssh-rsa AAAAB3NzaC1y....
  volumes:
    - /root:/user:rw