2013-08-27 67 views
0
 
docker run -i -t dhrp/sshd /bin/bash 

[email protected]>passwd 

...change the pw 

In another shell : 

docker commit f123d1d12d max/sshd 

fbf0b19e284f 

[email protected]:~$ docker images 

max/sshd   latest   fbf0b19e284f 13 seconds ago 21.12 kB 

Then I start the container : 

docker run -d -p 22 max/sshd /usr/sbin/sshd -D 
docker ps 

ID     IMAGE    COMMAND    CREATED    STATUS    PORTS 
440871de534f  dhrp/sshd:latest /bin/bash   34 seconds ago  Up 34 seconds    
49164->22 

then I try to login : 

[email protected] 49164 

using the password "commited" earlyer, and it fails (invalid passwd or username).... 


To make sure the commit is done properly I did : 

echo 123 > test 

inside the container before the commit 

and then run 

>docker run max/sshd cat test 
>123 

so the commit is doing something, just not persisting the passwd command... 

Versions : 

[email protected]:~$ docker version 
Client version: 0.5.0 
Server version: 0.5.0 
Go version: go1.1 

and dhrp/sshd is whatever happens to be in the docker index.... 

回答

0

好吧,這裏的問題是什麼:

不調用適當的SSH客戶端:

根@本地49164

應該是:

根@本地-p 49164

我會關閉該曲因爲它只會增加噪音....

+0

聽起來像是正確的事情,但爲什麼你沒有關閉它? – Anto