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. PM-软件最难的不是开发程序,而是需求

    最近几个月,关于人工智能的惊人文章在互联网泛滥.这也引发了很多人的担心--软件开发人员可能很快就会失业,被人工智能取代.他们想象所有的企业高管和产品研究人员将绕过大多数或所有的软件开发人员,直接要求人 ...

  2. 履机乘变,轻舟便楫:源启分布式PaaS深度赋能企业级技术平台建设

    导语 源启分布式PaaS平台围绕应用视角为用户提供应用运行的全生命周期管控能力,提供注册中心.服务路由.网关.服务治理等中间件技术支持,实现应用之间的联通,解决客户多厂商产品不兼容.产品组合不可选择. ...

  3. 刷到一个 MLSQL 语言

    在 https://www.infoq.cn/video/2vFUBYfxFcoFWmSm5WOj 刷到一个 MLSQL 语言,主页 https://www.mlsql.tech/home ,意思是用 ...

  4. 【数据结构】【折半查找法】【二分查找法】Java代码

    public class half { public static int find(int[] nums,int num){ int max=nums.length-1; int min=0; in ...

  5. 【人工智能】【深度学习】CUDA与CUDNN安装

    cuDA安装 基础 CUDA工具包 NVIDIA CUDA 工具包提供了开发环境,可供创建经 GPU 加速的高性能应用.借助 CUDA 工具包,您可以在经 GPU 加速的嵌入式系统.台式工作站.企业数 ...

  6. linux 安装navicat16-premium-cs 并破解

    https://ylyhappy.gitee.io/posts/linux/install-navciat.html #破解navicat16 使用 navicat-keygen for linux ...

  7. 【sprinb-boot】@ComponentScan 跳过扫描 excludeFilters

    @ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {Contr ...

  8. Fastadmin框架,服务器搭建环境

    FastAdmin 基于ThinkPHP和Bootstrap的极速后台开发框架 https://www.fastadmin.net 安装node.js 1.获取node.js资源 V8.x: curl ...

  9. Qt血的教训/细数Qt开发的各种坑/又爱又恨/欢迎围观留言评论

    一.吐槽总结 搞Qt开发十几年了,最初从Qt4.6开始,一直追新到现在的6.7版本,中间经历过无数的血的教训,简直是又爱又恨.其实Qt挺好的,但是还是要忍不住吐槽一下,本人还是希望Qt发展的越来越好, ...

  10. Qt编写的项目作品19-图片及视频TCP/UDP网络传输

    一.功能特点 多线程收发图片数据和解析图片数据,不卡主界面. 同时支持TCP和UDP两种模式,封装了TCP模式以及UDP模式的客户端类和服务端类. 图片传输客户端同时支持发送到多个服务端,可以作为一个 ...