1、docker search 查找ngix

2、docker pull下载镜像

3、查看镜像列表

4、docker run启动容器

5、测试nginx容器是否启动成功

1、docker search 查找ngix

[root@node01 ~]# docker search nginx
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
nginx Official build of Nginx. 18563 [OK]
unit Official build of NGINX Unit: Universal Web … 4 [OK]
nginxproxy/nginx-proxy Automated Nginx reverse proxy for docker con… 87
nginxproxy/acme-companion Automated ACME SSL certificate generation fo… 113
bitnami/nginx Bitnami nginx Docker Image 164 [OK]
bitnami/nginx-ingress-controller Bitnami Docker Image for NGINX Ingress Contr… 29 [OK]
ubuntu/nginx Nginx, a high-performance reverse proxy & we… 95
nginxproxy/docker-gen Generate files from docker container meta-da… 12
kasmweb/nginx An Nginx image based off nginx:alpine and in… 6
rancher/nginx-ingress-controller 11
rancher/nginx-ingress-controller-defaultbackend 2
bitnami/nginx-exporter 3
rancher/nginx 2
rapidfort/nginx-ib RapidFort optimized, hardened image for NGIN… 10
rapidfort/nginx RapidFort optimized, hardened image for NGINX 14
vmware/nginx-photon 1
bitnami/nginx-ldap-auth-daemon 3
rapidfort/nginx-official RapidFort optimized, hardened image for NGIN… 10
vmware/nginx 2
rancher/nginx-conf 0
linuxserver/nginx An Nginx container, brought to you by LinuxS… 201
nginxproxy/forego Foreman in Go 0
privatebin/nginx-fpm-alpine PrivateBin running on an Nginx, php-fpm & Al… 72 [OK]
bitnami/nginx-intel 1
bitnamicharts/nginx 0
[root@node01 ~]#

2、docker pull下载镜像

[root@node01 ~]# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
f03b40093957: Pull complete
eed12bbd6494: Pull complete
fa7eb8c8eee8: Pull complete
7ff3b2b12318: Pull complete
0f67c7de5f2c: Pull complete
831f51541d38: Pull complete
Digest: sha256:af296b188c7b7df99ba960ca614439c99cb7cf252ed7bbc23e90cfda59092305
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
[root@node01 ~]#

3、docker images查看镜像列表

[root@node01 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest f9c14fe76d50 3 days ago 143MB
hello-world latest 9c7a54a9a43c 3 weeks ago 13.3kB
mysql latest 8189e588b0e8 5 weeks ago 564MB
centos latest 5d0da3dc9764 20 months ago 231MB
[root@node01 ~]#
[root@node01 ~]#

4、docker run启动容器

[root@node01 ~]# docker run -d --name nginx01 -p 3344:80 nginx
a8c7e5cdd790f5febe9dfa7648b29e8a145c9e5314fca723cb186343bf8d605f
[root@node01 ~]#
[root@node01 ~]#
[root@node01 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a8c7e5cdd790 nginx "/docker-entrypoint.…" 2 seconds ago Up 2 seconds 0.0.0.0:3344->80/tcp, :::3344->80/tcp nginx01
740ee6cbc783 centos "bash" 12 minutes ago Up 12 minutes reverent_bardeen
[root@node01 ~]#
[root@node01 ~]#

5、测试nginx容器是否启动成功

[root@node01 ~]# curl localhost:3344
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p> <p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p> <p><em>Thank you for using nginx.</em></p>
</body>
</html>
[root@node01 ~]#

Docker - 在docker中部署Nginx的更多相关文章

  1. Docker 在容器中部署静态网站

    Docker 在容器中部署静态网站 在容器中部署静态网站 设置容器的端口映射 run -P``--publish-all=true|false:容器暴露的所有端口进行映射 -p``--publish= ...

  2. Docker(二)-在Docker中部署Nginx实现负载均衡(视频教程)

    本教程介绍利用Docker部署Nginx服务实现负载均衡. (双击全屏播放)

  3. .NetCore中的程序通过Docker在CentOS中部署

    基础说明 安装Docker过程就略过了 创建一个Asp.Net Core程序 启用Docker支持,会生成Dockerfile文件,接下来看下这个文件,当然不同的版本生成的具体可能不一致 FROM m ...

  4. 在docker中部署nginx

    1端口映射 大写P  为容器暴漏的所有端口进行映射   -p ,--publish-all=true    docker run -P -it centos  /bin/bash 小写p  指定哪些容 ...

  5. docker 使用案例:部署nginx

    首先安装docker.可以参考这篇教程: http://www.runoob.com/docker/windows-docker-install.html 本教程以windows10+ubuntu:1 ...

  6. 在Centos中部署nginx

    准备工作: nginx的安装依赖openSSL,zlib和pcre Openssl下载地址: http://www.openssl.org/ zlib下载地址: http://www.zlib.net ...

  7. Docker 06 部署Nginx

    参考源 https://www.bilibili.com/video/BV1og4y1q7M4?spm_id_from=333.999.0.0 https://www.bilibili.com/vid ...

  8. 在Docker下部署Nginx

    在Docker下部署Nginx 在Docker下部署Nginx,包括: 部署一个最简单的Nginx,可以通过80端口访问默认的网站 设置记录访问和错误日志的路径 设置静态网站的路径 通过proxy_p ...

  9. Docker 案例: 在容器中部署静态网站

    ----------------知识点------------ 容器的端口映射: docker  run  [-P] [-p] -P,–publish-all=true | false,大写的P表示为 ...

  10. 【原创】大数据基础之Mesos+Marathon+Docker部署nginx

    一 安装 安装docker:https://www.cnblogs.com/barneywill/p/10343091.html安装mesos:https://www.cnblogs.com/barn ...

随机推荐

  1. 待遇任务执行器(dy-task-actuator-simple)文档

    待遇任务执行器(dy-task-actuator-simple)文档 简介 简称 dtas 吧.这是一个尚在起步但无需太多功能的执行器. 心血来潮,做了一个任务执行器,倒不是一定要重复造轮子,而是没有 ...

  2. [Mybatis Plus]lambdaQueryWrapper和QueryWrapper的选择

    结论 更推荐使用:LambdaQueryWrapper QueryWrapper:灵活但是不够类型安全 LambdaQueryWrapper:安全 分析 在MyBatis-Plus中,QueryWra ...

  3. 【C#】【类设计器】【类图】类图安装与简单使用

    安装 使用 Ctrl + Shift + A 或者按下图操作

  4. Vulnhub经典靶机:from_sqli_to_shell_i386入门靶机

    靶机官网: https://www.vulnhub.com/entry/pentester-lab-from-sql-injection-to-shell,80/ 靶机镜像ISO下载地址:(转链) f ...

  5. Ubuntu 22.04 LTS 代号已经公布:那就是 Jammy Jellyfish

    Ubuntu 22.04 LTS 代号已在 Ubuntu 开发之家 Launchpad 上公布. 在字母系列中的字母"I"之后,是"J". 因此,Canonic ...

  6. Vetur can't find `tsconfig.json` or `jsconfig.json` in XXX

    vue界面启动项目 visual code报错 如下图,找到 Ignore Project Warning 前边打上对勾

  7. 阿里云maven仓库地址的配置

    两种配置方式: 1. maven 配置文件配置settings.xml中设置mirror节点 <mirror> <id>nexus-aliyun</id> < ...

  8. [转]Winform实现多线程异步更新UI(进度及状态信息)

    引言 在进行Winform程序开发需要进行大量的数据的读写操作的时候,往往会需要一定的时间,然在这个时间段里面,界面ui得不到更新,导致在用户看来界面处于假死的状态,造成了不好的用户体验.所以在大量数 ...

  9. Golang-语言简介1

    http://c.biancheng.net/golang/intro/ Go语言的特性 Go语言也称为 Golang,是由 Google 公司开发的一种静态强类型.编译型.并发型.并具有垃圾回收功能 ...

  10. Spring源码分析基本介绍

    Spring源码分析(一)基本介绍   摘要:本文结合<Spring源码深度解析>来分析Spring 5.0.6版本的源代码.若有描述错误之处,欢迎指正. 前言 作为一名开发人员,阅读源码 ...