[root@localhost ~]
Sending build context to Docker daemon 2.56 kB
Sending build context to Docker daemon
Step 0 : FROM centos:centos7
---> ae0c2d0bdc10
Step 1 : MAINTAINER Qicheng, http:
//qicheng0211
.blog.51cto.com/
---> Running
in
26c2fddd9156
---> 1807df1e23db
Removing intermediate container 26c2fddd9156
Step 2 : RUN yum
install
passwd
openssl openssh-server -y
---> Running
in
e10f052d4263
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
......
Installed:
openssh-server.x86_64 0:6.4p1-8.el7 openssl.x86_64 1:1.0.1e-34.el7_0.6
passwd
.x86_64 0:0.79-4.el7
Dependency Installed:
fipscheck.x86_64 0:1.4.1-5.el7 fipscheck-lib.x86_64 0:1.4.1-5.el7
make
.x86_64 1:3.82-21.el7 openssh.x86_64 0:6.4p1-8.el7
tcp_wrappers-libs.x86_64 0:7.6-77.el7
Complete!
---> 20e63694ff20
Removing intermediate container e10f052d4263
Step 3 : RUN
echo
'123456'
|
passwd
--stdin root
---> Running
in
d0f1b578cc27
Changing password
for
user root.
passwd
: all authentication tokens updated successfully.
---> f1b73ad76b66
Removing intermediate container d0f1b578cc27
Step 4 : RUN
ssh
-keygen -q -t rsa -b 2048 -f
/etc/ssh/ssh_host_rsa_key
-N
''
---> Running
in
f31b1aa24883
---> 647bb8cb3fc9
Removing intermediate container f31b1aa24883
Step 5 : RUN
ssh
-keygen -q -t ecdsa -f
/etc/ssh/ssh_host_ecdsa_key
-N
''
---> Running
in
401c7e2cf34d
---> f79b9c8bf108
Removing intermediate container 401c7e2cf34d
Step 6 : RUN
sed
-i
'/^session\s\+required\s\+pam_loginuid.so/s/^/#/'
/etc/pam
.d
/sshd
---> Running
in
00c28bea761b
---> 50f7f29c64a9
Removing intermediate container 00c28bea761b
Step 7 : RUN
mkdir
-p
/root/
.
ssh
&&
chown
root.root
/root
&&
chmod
700
/root/
.
ssh
---> Running
in
a3a94d599b6b
---> f91df92e2194
Removing intermediate container a3a94d599b6b
Step 8 : EXPOSE 22
---> Running
in
28ee83c39a27
---> 7a82bca0db6a
Removing intermediate container 28ee83c39a27
Step 9 : CMD ip addr
ls
eth0 |
awk
'{print $2}'
|
egrep
-o
'([0-9]+\.){3}[0-9]+'
;
/usr/sbin/sshd
-D
---> Running
in
41d58259b402
---> bd345297137b
Removing intermediate container 41d58259b402
Successfully built bd345297137b
[root@localhost ~]
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
centos autosshd bd345297137b 3 minutes ago 300 MB
centos centos7 ae0c2d0bdc10 4 weeks ago 224 MB
centos latest ae0c2d0bdc10 4 weeks ago 224 MB