Docker——第一个docker服务tomcat(五)

来源:互联网 发布:cae软件 nvh 编辑:程序博客网 时间:2024/06/07 06:23

一、启动docker服务

命令:service docker start

二、拉取远程tomcat镜像

命令:docker pull hub.c.163.com/public/tomcat:7.0.28

[root@localhost ~]# docker pull hub.c.163.com/public/tomcat:7.0.287.0.28: Pulling from hub.c.163.com/public/tomcat8593960258c7: Pull complete f97837652049: Pull complete 0faf59cbedf9: Pull complete 0a23a1c4711e: Pull complete a42e8541d632: Pull complete a42c06d4ffde: Pull complete 1eafa3b80820: Pull complete a3ac748dda67: Pull complete 8231987760c3: Pull complete 7f691165798d: Pull complete 34677960a42c: Pull complete 240ce29b9b50: Pull complete 48499b64863c: Pull complete 5a34d7155f58: Pull complete 7b5203c9ec9d: Pull complete 13a82fc0f1ad: Pull complete ed088def6bb6: Pull complete fc183a0d37c6: Pull complete e28100d48224: Pull complete 9e73de1e2f9e: Pull complete 8520f93a0277: Pull complete 8eeaec7c3c93: Pull complete 26efb6f292a5: Pull complete a3c2d8714b1c: Pull complete Digest: sha256:dd6c708e981e61f6aae56dac2ef91a78b28e0589743b44b7f174a57b1f097154Status: Downloaded newer image for hub.c.163.com/public/tomcat:7.0.28[root@localhost ~]# docker imagesREPOSITORY                          TAG                 IMAGE ID            CREATED             VIRTUAL SIZEhub.c.163.com/wangjiaen/centos6.9   ssh                 5caf8ed79df7        9 weeks ago         370.9 MBhub.c.163.com/public/tomcat         7.0.28              a3c2d8714b1c        15 months ago       266.9 MB[root@localhost ~]#

三、运行tomcat镜像

命令:docker run -d -itp 80:8080 a3c2d8714b1c  (后台运行ID为a3c2d8714b1c的镜像即刚拉取的tomcat,并映射docker内部tomcat端口8080到宿主机80端口)

[root@localhost ~]# docker run -d -itp 80:8080 a3c2d8714b1cd25da87150f2c6abc88035d39f17ea65e6663aaad28e0d55a59f2894e86a2bb9

四、访问tomcat服务


如图所示成功的运行了tomcat服务。





内链:

Docker——YUM升级centOS内核(一)

Docker——安装部署(二)

Docker——版本升级(三)

Docker——常用命令(四)

Docker——第一个docker服务tomcat(五)

Docker——给tomcat容器部署项目并且做成新的镜像(容器内外拷贝)(六)

原创粉丝点击