Closed ForbiddenEra closed 9 years ago
Baseimage-docker disables the SSH server by default. Add the following to your Dockerfile to enable it:
RUN rm -f /etc/service/sshd/down RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
Hi,
Thanks for your fast response!
I thought that was the case - but why doesn't that happen on 0.9.15? Or is this a change for 0.9.16?
Is this documented somewhere?
Seems to me that changes that break things would be saved for the next version branch?
Actually - do I HAVE to put
RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
? it seems this is still run by default anyway, you can see that in my above post, I quote:
core@core1 ~ $ docker run -h apache6 --name="apache6" -p 80:80 shaped/ubu1:base0.9.16
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
I can confirm that only
RUN rm -f /etc/service/sshd/down
is required in the Dockerfile as the init script is ran regardless...?
I do see this mentioned in the readme (and says it needs both commands), however, there's nothing regarding this in the changelog..? So, if this is not new behavior, why does 0.9.15 work that way?
Also odd that both you & the readme say we need both but apparently the script is always run.
The script checks for the presence of /etc/service/sshd/down
so, why would we need both anyway?
OK, actually you only need to rm /etc/service/sshd/down. you needn't to run 00_regen_ssh_host_keys.sh manually, because the scripts in /etc/my_init.d/ will run automatically. i think the author made a mistake in readme, but i am not sure that.
@ForbiddenEra Yes this is change in 0.9.16. All changes are documented in the changelog.
Official documentation on enabling SSH: https://github.com/phusion/baseimage-docker#enabling_ssh
Actually - do I HAVE to put RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
If you don't, then every time you start the container you will get a different SSH host key. This may or may not be what you want.
My bad -- I see it now in the changelog, but it should have been given it's own bullet point maybe ;-)
Still seems like a 'big' change for a small version increment but - obviously it's not an 'issue' - thanks for pointing out my blindness. ;-)
Also - the documentation says you have to exec BOTH commands in your Dockerfile - we've put that to rest - should I open separate issue for the readme issue or - will this comment be enough?
That's why the versioning is still 0.9. Docker is moving too fast, so Baseimage-docker has to move fast too. Because of the fast pace of change I'm not comfortable with giving any kinds of stability guarantees yet.
The documentation doesn't say you have to execute both. It says you can comment out the regen_ssh_host_keys, if you understand the implications.
EDIT: This is notabug / no issue. REASON: ssh disabled by default as of 0.9.16 & changelog does state this - I just didn't see the entry in the changelog.
Maybe I'm missing something, but, I tried building an image with 0.9.16 with the same Dockerfile I used for 0.9.15 and, it doesn't appear to be working correctly - I cannot ssh.
Expected, 0.9.15:
And, I can SSH into it, just fine:
Now, let's try the same thing with 0.9.16:
And, I am unable to SSH..
Notice the SSH keys aren't generated? I noticed, so I tried just opening bash in the image, I see the 00_regen_ssh_host_keys.sh script, which doesn't exec because /etc/service/sshd/down exists:
WoopWoop? Only thing that has changed is using baseimage:0.9.15 vs baseimage:0.9.16.