Dockerfile之nginx(六)
docker login www.lereun.com:

curl -u 账号:密码 https://www.lereun.com:5000/v2/_catalog

docker pull www.lereun.com:/centos


mkdir /root/Docker

#基础镜像
FROM www.lereun.com:/centos #维护者
MAINTAINER @qq.com #把nginx的压缩包拷贝至/usr/local/docker下并解压
ADD nginx-1.12..tar.gz /usr/local/docker #安装依赖包
RUN yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel
RUN yum install -y libxslt-devel -y gd gd-devel GeoIP GeoIP-devel pcre pcre-devel
RUN useradd nginx #改变当前路径,相当于cd进去了
WORKDIR /usr/local/docker/nginx-1.12. #编译安装
RUN ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module && make && make install #添加环境变量
ENV PATH /usr/local/nginx/sbin:$PATH #运行nginx,这样在启动容器的时候就不需要再带nginx启动
CMD /bin/sh -c 'nginx -g "daemon off;"' EXPOSE
docker build -t centos_nginx .

mkdir -p /docker/nginx
docker run -d -p : -v /docker/nginx/conf.d:/usr/local/nginx/conf/conf.d -v /docker/nginx/nginx.conf:/usr/local/nginx/conf/nginx.conf -v /docker/nginx/log:/usr/local/nginx/logs centos_nginx

user nginx nginx; worker_processes ;
error_log logs/error.log info;
pid logs/nginx.pid;
worker_rlimit_nofile ; events {
use epoll;
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; server_tokens off;
sendfile on;
tcp_nopush on;
keepalive_timeout ;
gzip on; include /usr/local/nginx/conf/conf.d/*; server {
listen 80;
server_name localhost; location /{
index index.php index.html index.htm;
} } }




location /testdocker{
return ;
}
docker container restart 0177578edf39





{
"insecure-registries": [
"www.lereun.com:5000"
]
}
systemctl restart docker
docker tag centos_nginx www.lereun.com:/centos_nginx



Dockerfile之nginx(六)的更多相关文章
- 使用dockerfile构建nginx镜像
使用dockerfile构建nginx镜像 docker构建镜像的方法: commit.dockerfile 1.使用commit来构建镜像: commit是基于原有镜像基础上构建的镜像,使用此方 ...
- Dockerfile构建nginx镜像
Dockerfile构建nginx镜像 [root@bogon ~]# mkdir /opt/docker-file [root@bogon ~]# cd /opt/docker-file/ [roo ...
- Docker Alpine Dockerfile 安装nginx,最小镜像
Docker Alpine Dockerfile 安装nginx,最小镜像 FROM alpine MAINTAINER will ## 将alpine-linux:apk的安装源改为国内镜像 RUN ...
- dockerfile构建nginx并结合php
转自:https://www.cnblogs.com/jsonhc/p/7799358.html 查看nginx和php的目录结构: [root@docker docker_demo]# tree n ...
- 9、Dockerfile实战-Nginx
上一节我们详解Dockerfile之后,现在来进行实战.我们通过docker build来进行镜像制作. build有如下选项: [root@localhost ~a]# docker build - ...
- 通过dockerfile构建nginx
上次 利用命令行的形式来构建nginx服务, http://www.cnblogs.com/loveyouyou616/p/6806788.html 这次利用dockerfile文件来构建nginx服 ...
- centos7 Dockerfile安装nginx
1.写一个Dockerfile文件 FROM centos MAINTAINER apeng apeng@apenglinux-002.com RUN yum install -y pcre-deve ...
- dockerfile+ubuntu+nginx搭建web环境
准备目录 [root@izchz ~]# mkdir /usr/local/dockerfile1 该目录下准备Dockerfile文件 FROM ubuntu MAINTAINER xbf RUN ...
- dockerfile构建nginx
mkdir docker_demo cd docker_demo wget http://nginx.org/download/nginx-1.2.9.tar.gz vim Dockerfile FR ...
随机推荐
- HRBUST 1186 青蛙过河 (思路错了)
在河上有一座独木桥,一只青蛙想沿着独木桥从河的一侧跳到另一侧.在桥上有一些石子,青蛙很讨厌踩在这些石子上.由于桥的长度和青蛙一次跳过的距离都是正整数,我们可以把独木桥上青蛙可能到达的点看成数轴上的一串 ...
- ES6标准之箭头函数
语法 具有一个参数的简单函数 var single = a => a single('hello, world') // 'hello, world' 没有参数的需要用在箭头前加上小括号 var ...
- Centos 中 service iptables stop 失败
Centos7中的防火墙调整为firewalld,试一下systemctl stop firewalld关闭防火墙.
- yii中的restful方式输出并调用接口和判断用户是否登录状态
//创建一个控制器接口 返回的是restful方式 <?php namespace frontend\controllers; use frontend\models\Fenlei; use f ...
- 『OpenCV3』霍夫变换原理及实现
霍夫变换常用于检测直线特征,经扩展后的霍夫变换也可以检测其他简单的图像结构. 在霍夫变换中我们常用公式 ρ = x*cosθ + y*sinθ 表示直线,其中ρ是圆的半径(也可以理解为原点到直线的距离 ...
- hdu6133 Army Formations 线段树合并
给你一棵有n个节点的二叉树,每个节点有一个权值,对于一棵子树u,将u的子树中的节点权值从大到小排序,令sz[u]为子树u的大小, 则ans[u] = 1 * a[1] + 2 * a[2] + ... ...
- 如何从零开始在github上新建项目
准备工作: (1)安装git: Git-2.16.1-64-bit.exe (2)新建一个文件夹grpc007,作为本地git仓库 (3)进入到grpc007目录,右键/打开git bash.使用gi ...
- Oracle DB 使用RMAN恢复目录
• 对恢复目录和RMAN 资料档案库控制文件的使用进行比较• 创建和配置恢复目录• 在恢复目录中注册数据库• 同步恢复目录• 使用RMAN 存储脚本• 备份恢复目录• 创建虚拟专用目录 RMAN 资料 ...
- 牛客网多校第3场C-shuffle card 平衡树或stl(rope)
链接:https://www.nowcoder.com/acm/contest/141/C 来源:牛客网 题目描述 Eddy likes to play cards game since there ...
- 使用 udev 高效、动态地管理 Linux 设备文件
本文转自:https://www.ibm.com/developerworks/cn/linux/l-cn-udev/index.html 概述: Linux 用户常常会很难鉴别同一类型的设备名,比如 ...