Installing ssh-keyscan on Alpine linux?

FuzzyAmi picture FuzzyAmi · May 29, 2016 · Viewed 13.2k times · Source

In order to successfully clone a private repository into an Alpine-based docker, I needed to run the following command: ssh-keyscan github.com >> ~/.ssh/known_hosts.

But since ssh-keyscan isn't part of Alpine linux (by default), I have to install it first with apk. The problem is: I dont know how - and I can't find it anywhere on Google.

Answer

FuzzyAmi picture FuzzyAmi · May 29, 2016

This took way too long to find out as its not documented anywhere:

apk update && apk add openssh

or alternatively:

apk add -qU openssh