网站首页 > 技术教程 正文
-----------------------第一步:拉取镜像-------------------
[root@localhost ~]# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
b380bbd43752: Pull complete
fca7e12d1754: Pull complete
745ab57616cb: Pull complete
a4723e260b6f: Pull complete
1c84ebdff681: Pull complete
858292fd2e56: Pull complete
Digest: sha256:644a70516a26004c97d0d85c7fe1d0c3a67ea8ab7ddf4aff193d9f301670cf36
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
-----------------------第二步:查看镜像-------------------
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
redis latest 7faaec683238 9 days ago 113MB
nginx latest 87a94228f133 10 days ago 133MB
tomcat 8.5.15-jre8 b8dfe9ade316 4 years ago 334MB
daocloud.io/library/mysql 5.7.4 aa5364eb3d85 7 years ago 252MB
-----------------------第三步:linux中的端口对docker中容器端口进行映射并后台运行-------------------
[root@localhost ~]# docker run -d -p 80:80 --name nginx 87a94228f133
b0bc06dd7caecda671a23021d72a05184c71c73b0dd82bb15698a39c6a00f683
-----------------------第四步:查看已经运行的容器-------------------
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b0bc06dd7cae 87a94228f133 "/docker-entrypoint.…" 49 minutes ago Up 49 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp nginx
b5b284d3d5fa b8dfe9ade316 "catalina.sh run" 5 hours ago Up 5 hours 0.0.0.0:8081->8080/tcp, :::8081->8080/tcp tomcat
f34e4b9e9bb5 7faaec683238 "docker-entrypoint.s…" 5 hours ago Up 5 hours 0.0.0.0:6380->6379/tcp, :::6380->6379/tcp redis
运行结果:
本次用的服务器是三丰云的免费服务器,永久免费,有需要的,可以申请下
三丰云 https://www.sanfengyun.com
猜你喜欢
- 2024-09-12 nginx 4层转发、代理、负载均衡(nginx 4层代理 源ip)
- 2024-09-12 没有我学不会之Linux源码脚本安装Nginx教程
- 2024-09-12 Linux中如何简单快速安装nginx以及如何配置
- 2024-09-12 和我一起来学习Linux安装Nginx(linux yum安装nginx)
- 2024-09-12 对标腾讯,阿里,字节的C/C++/Linux后台服务器开发技术体系
- 2024-09-12 linux如何安装nginx(linux yum安装nginx)
- 2024-09-12 虚拟机(linux)下安装nginx的步骤教程
- 2024-09-12 nginx入门1——linux上安装nginx(在linux中安装nginx可以用哪些命令)
- 2024-09-12 Linux系统nginx虚拟主机示例(虚拟机安装nginx主机访问失败)
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)