mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update SSH demo to ubuntu 14.04
Signed-off-by: Jan Keromnes <janx@linux.com>
This commit is contained in:
parent
bc26aa7b50
commit
98f57d1c39
1 changed files with 7 additions and 5 deletions
|
@ -12,12 +12,13 @@ quick access to a test container.
|
||||||
#
|
#
|
||||||
# VERSION 0.0.1
|
# VERSION 0.0.1
|
||||||
|
|
||||||
FROM ubuntu:12.04
|
FROM ubuntu:14.04
|
||||||
MAINTAINER Thatcher R. Peskens "thatcher@dotcloud.com"
|
MAINTAINER Thatcher R. Peskens "thatcher@dotcloud.com"
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y openssh-server
|
RUN apt-get update && apt-get install -y openssh-server
|
||||||
RUN mkdir /var/run/sshd
|
RUN mkdir /var/run/sshd
|
||||||
RUN echo 'root:screencast' | chpasswd
|
RUN echo 'root:screencast' | chpasswd
|
||||||
|
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||||
|
|
||||||
EXPOSE 22
|
EXPOSE 22
|
||||||
CMD ["/usr/sbin/sshd", "-D"]
|
CMD ["/usr/sbin/sshd", "-D"]
|
||||||
|
@ -33,8 +34,9 @@ the container's port 22 is mapped to:
|
||||||
$ sudo docker port test_sshd 22
|
$ sudo docker port test_sshd 22
|
||||||
0.0.0.0:49154
|
0.0.0.0:49154
|
||||||
|
|
||||||
And now you can ssh to port `49154` on the Docker daemon's host IP
|
And now you can ssh as `root` on the container's IP address (you can find it
|
||||||
address (`ip address` or `ifconfig` can tell you that):
|
with `docker inspect`) or on port `49154` of the Docker daemon's host IP address
|
||||||
|
(`ip address` or `ifconfig` can tell you that):
|
||||||
|
|
||||||
$ ssh root@192.168.1.2 -p 49154
|
$ ssh root@192.168.1.2 -p 49154
|
||||||
# The password is ``screencast``.
|
# The password is ``screencast``.
|
||||||
|
|
Loading…
Add table
Reference in a new issue