SSH keys for the docker container?

(Nate Finch) #1

I noticed that after I installed discourse using the digital ocean install steps, when I went to use launcher rebuild, it said there was no ssh key for the container, and asked me if I wanted to create one. Is there a way to create the SSH key during install?

Asking for two reasons - one, is that it would be nice to be able to connect to the container and the other is that I’m calling rebuild from a non-interactive session, so it’ll never actually finish since I can’t answer the question.

(Dave McClure) #2

Not a direct answer to your question, but you can get into the container without ssh using:

launcher enter app

(Jeff Atwood) #3

If the install created a SSH key for the root user (that is you did not answer NO to the prompt) you can simply do ./launcher ssh app

(Nate Finch) #4

@codinghorror my question was really - is there a way to avoid the prompt all together? I have a script to deploy discourse, but the prompt is screwing it up. The launcher help doesn’t seem to indicate a way to avoid that prompt (many scripts that have prompts like that support a -y flag to just say yes to whatever prompts it has, to make them more scriptable).

(Jens Maier) #5

As a kludge, you can use expect(1) to automatically reply to the prompt.

(Nate Finch) #6

Ahh thanks, I’m not a linux CLI expert. That’s a big help, for sure.

(Nate Finch) #7

So, I did some googling and managed to figure out a way that works, since I’m running the script from Go code. If I give it a stdin pipe and then close it, it seems to realize it’s not going to get any input and runs fine.

(Sam Saffron) #8

I don’t mind a PR that adds a -y to ./launcher if you feel up to it.