docker现在是比较火的一门技术,作为一名运维从业者对docker的学习是自身知识的储备,也是自我能力的一种提升。
现在就来认识一下docker吧。
系统版本
[root@CFCA ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)
内核:
[root@CFCA ~]# uname -r
3.10.0-693.el7.x86_64
[root@CFCA ~]# yum install docker -y
[root@CFCA ~]# systemctl start docker
[root@CFCA ~]# docker run -d -p 80:80 httpd
Unable to find image 'httpd:latest' locally
Trying to pull repository docker.io/library/httpd ...
latest: Pulling from docker.io/library/httpd
f189db1b88b3: Pull complete
ba2d31d4e2e7: Pull complete
23a65f5e3746: Pull complete
5e8eccbd4bc6: Pull complete
4c145eec18d8: Pull complete
1c74ffd6a8a2: Pull complete
1421f0320e1b: Pull complete
Digest: sha256:8631904c6e92918b6c7dd82b72512714e7fbc3f1a1ace2de17cb2746c401b8fb
Status: Downloaded newer image for docker.io/httpd:latest
7964bb9522b240131b2e83b11a9e8458ea601f8b47344d567d8481aa65160a10
通过浏览器验证容器是否正常工作。
过程描述:
1、从docker hub下载httpd镜像。镜像中已经安装好了Apache httpd server
2、启动httpd服务,并将容器的80端口映射到host的80端口