• Docker(5) docker部署nginx


    搜索nginx镜像

    (建议去hub.docker.com上去查找)

    # 下载镜像
    docker pull  nginx
    
    # 检查镜像是否下载成功
    docker images
    
    [root@iZuf63tzd3n3bijtsfqsk5Z ~]# docker images 
    REPOSITORY    TAG       IMAGE ID       CREATED        SIZE
    mysql         latest    bbf6571db497   10 days ago    516MB
    nginx         latest    f652ca386ed1   10 days ago    141MB
    hello-world   latest    feb5d9fea6a5   2 months ago   13.3kB
    centos        latest    5d0da3dc9764   2 months ago   231MB
    
    # 运行容器
    -d      后台运行
    --name  自定义容器名
    -p 主机端口:容器内端口
    [root@iZuf63tzd3n3bijtsfqsk5Z ~]# docker run -d --name nginx01 -p 3344:80 nginx
    4cc38119d9d67cecfe1a91c77835b796545d6e7ac0f72b7339aa55cf9bdf07d0
    
    #检查是否成功,ping下端口

    [root@iZuf63tzd3n3bijtsfqsk5Z ~]# curl localhost:3344


    <!DOCTYPE html>
    <html>
    <head>
    <title>Welcome to nginx!</title>
    <style>
    html { color-scheme: light dark; }
    body { 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>

    
    
  • 相关阅读:
    python
    在liunx环境下安装python
    解决用navicate远程连接数据库出现1045
    mysql的监控及优化
    mysql基础
    linux基础学习
    Effective c++ 第一章 让自己习惯C++
    读前感
    socket编程:客户端与服务器间的连接以及各函数的用法
    生成任意区间的随机数
  • 原文地址:https://www.cnblogs.com/xinhua19/p/15680715.html
Copyright © 2020-2023  润新知