terraform-provider-docker/examples/ssh-protocol
2021-05-13 08:06:55 +02:00
..
main.tf chore: apply documentation generation 2021-05-13 08:06:55 +02:00
README.md Add ssh protocol (copy) (#153). Closes #112 2019-05-26 21:06:10 +02:00

Using and testing the ssh-protocol

The ssh:// which was introduced in docker can be tested/used as shown in this example.

# export your pub key(s) in terraform pub_key variable
export TF_VAR_pub_key="$(cat ~/.ssh/*.pub)"

# launch dind container with ssh and docker accepting your PK for root user
terraform apply -target docker_container.dind

# wait for few seconds/minutes

# ssh to container to remember server keys
ssh root@localhost -p 32822 uptime

# test docker host ssh protocol
terraform apply -target docker_image.test