CentOS 7安装Docker服务详细过程

2020-06-17 06:59:35易采站长站整理

Public key for httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total 382 kB/s | 24 MB 01:05
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-2.1511.el7.centos.2.10.x86_64 (@CentOS)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-3.el7.x86_64 1/6
Installing : apr-util-1.5.2-6.el7.x86_64 2/6
Installing : httpd-tools-2.4.6-40.el7.centos.4.x86_64 3/6
Installing : centos-logos-70.0.6-3.el7.centos.noarch 4/6
Installing : mailcap-2.1.41-2.el7.noarch 5/6
Installing : httpd-2.4.6-40.el7.centos.4.x86_64 6/6
Verifying : apr-1.4.8-3.el7.x86_64 1/6
Verifying : httpd-tools-2.4.6-40.el7.centos.4.x86_64 2/6
Verifying : apr-util-1.5.2-6.el7.x86_64 3/6
Verifying : httpd-2.4.6-40.el7.centos.4.x86_64 4/6
Verifying : mailcap-2.1.41-2.el7.noarch 5/6
Verifying : centos-logos-70.0.6-3.el7.centos.noarch 6/6

Installed:
httpd.x86_64 0:2.4.6-40.el7.centos.4

Dependency Installed:
apr.x86_64 0:1.4.8-3.el7
apr-util.x86_64 0:1.5.2-6.el7
centos-logos.noarch 0:70.0.6-3.el7.centos
httpd-tools.x86_64 0:2.4.6-40.el7.centos.4
mailcap.noarch 0:2.1.41-2.el7

Complete!
---> 3ce9abf4dfea
Removing intermediate container 3d37e4919fa9
Step 4 : RUN echo "Hello LinuxProbe DockerFile" > /var/www/html/index.html
---> Running in 297d8d666c8d
---> 3d185363045b
Removing intermediate container 297d8d666c8d
Step 5 : EXPOSE 80
---> Running in 017db517e06a
---> 5c855e478c3c
Removing intermediate container 017db517e06a
Step 6 : CMD -D FOREGROUND
---> Running in 6add13fca3cb
---> 7a219d9fa6e1
Removing intermediate container 6add13fca3cb
Step 7 : ENTRYPOINT /usr/sbin/httpd
---> Running in da4671709ee1
---> c0d84e256068
Removing intermediate container da4671709ee1
Successfully built c0d84e256068
[root@linuxprobe ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/centos latest 0584b3d2cf6d Less than a second ago 196.5 MB
web_server latest c0d84e256068 36 seconds ago 338.3 MB
my_image/centos_httpd latest b0be2940865a 4 hours ago 338.3 MB
[root@linuxprobe ~]# docker run -d -p 80:80 web_server
c37d25a405a8e0599bf54fe77d78c807a520242a21ccb15b18d6b6ee4d13415b
[root@linuxprobe ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES