Docker - 在docker中部署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的更多相关文章
- Docker 在容器中部署静态网站
Docker 在容器中部署静态网站 在容器中部署静态网站 设置容器的端口映射 run -P``--publish-all=true|false:容器暴露的所有端口进行映射 -p``--publish= ...
- Docker(二)-在Docker中部署Nginx实现负载均衡(视频教程)
本教程介绍利用Docker部署Nginx服务实现负载均衡. (双击全屏播放)
- .NetCore中的程序通过Docker在CentOS中部署
基础说明 安装Docker过程就略过了 创建一个Asp.Net Core程序 启用Docker支持,会生成Dockerfile文件,接下来看下这个文件,当然不同的版本生成的具体可能不一致 FROM m ...
- 在docker中部署nginx
1端口映射 大写P 为容器暴漏的所有端口进行映射 -p ,--publish-all=true docker run -P -it centos /bin/bash 小写p 指定哪些容 ...
- docker 使用案例:部署nginx
首先安装docker.可以参考这篇教程: http://www.runoob.com/docker/windows-docker-install.html 本教程以windows10+ubuntu:1 ...
- 在Centos中部署nginx
准备工作: nginx的安装依赖openSSL,zlib和pcre Openssl下载地址: http://www.openssl.org/ zlib下载地址: http://www.zlib.net ...
- Docker 06 部署Nginx
参考源 https://www.bilibili.com/video/BV1og4y1q7M4?spm_id_from=333.999.0.0 https://www.bilibili.com/vid ...
- 在Docker下部署Nginx
在Docker下部署Nginx 在Docker下部署Nginx,包括: 部署一个最简单的Nginx,可以通过80端口访问默认的网站 设置记录访问和错误日志的路径 设置静态网站的路径 通过proxy_p ...
- Docker 案例: 在容器中部署静态网站
----------------知识点------------ 容器的端口映射: docker run [-P] [-p] -P,–publish-all=true | false,大写的P表示为 ...
- 【原创】大数据基础之Mesos+Marathon+Docker部署nginx
一 安装 安装docker:https://www.cnblogs.com/barneywill/p/10343091.html安装mesos:https://www.cnblogs.com/barn ...
随机推荐
- vmware ESXi快速创建新的虚拟机
准备工作:新虚拟机Win10 安装后,需要windows update,更新补丁到最新,关机.(本文案例win10-Amadeus) 在数据盘新建Win10-Users文件夹(可自定义) 复制win ...
- C#调用Python代码的方式(二),以PaddleOCR-GUI为例
前言 前面介绍了在C#中使用Progress类调用Python脚本的方法,但是这种方法在需要频繁调用并且需要进行数据交互的场景效果并不好,因此今天分享的是C#调用Python代码的方式(二):使用py ...
- Axios 面试题 (2023-09-15更新)
有封装过 axios 么?封装一个 axios? import axios from 'axios' // 创建axios实例 const service = axios.create({ baseU ...
- Postgres中的Common Table Expression
Common Table Expression 是 pg 里极为重要的特性.这个特性简单的说就是 INSERT/UPDATE/DELTE 三项操作可以返回结果集.如: update item set ...
- 笔记-AM的正交解调法
1.AM的模拟调制过程 AM信号是一种振幅调制信号,其携带的信息保存在其信号的振幅中,通过改变载波的振幅来实现基带数据的传输. 其函数表达式如下: \[s(t) = (A + m(t))*cos( ...
- bouncycastle(BC) 实现SM2国密加解密、签名、验签
https://www.cnblogs.com/dashou/p/14656458.html SM2国密加解密一个类就够了 <dependency> <groupId>org. ...
- python连接pgsql&mysql
1.python连接pgsql import psycopg2 def connect_pgsql(list_sql): conn = psycopg2.connect(host='db_host', ...
- Mac 最大连接数和端口的相关参数
1. 最大连接数限制 最大连接数限制就是系统所能打开的最大文件数(文件描述符)的限制,分全局和进程两种: 1.1. 全局 $ sysctl kern.maxfiles kern.maxfiles: 4 ...
- 前端开发常用git命令详细版
1.新建代码库 当前目录创建一个git代码库 git init 新建一个目录文件 将其初始化为git代码库 git init [pro-name] 远端拉去项目 git clone [url] 2.基 ...
- Python库房管理系统开发指南
在现代仓储管理中,高效.准确的信息系统是提高运营效率的关键.Python作为一种强大且易于学习的编程语言,非常适合用来开发简易而功能齐全的库房管理系统.本文将详细介绍如何使用Python编写一个基本的 ...