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 ...
随机推荐
- inline-block有间隙的兼容处理
- webapi研究说明
首先定义公共的返回对象 /// <summary> /// 返回数据对象 /// </summary> public class ResponseItem<T> { ...
- MATLAB绘图功能(1) 二维高层绘图操作
文末源代码 部分源代码 %% 基本绘图操作 x=:*pi; y=sin(x); plot(x,y); % 第二个参数为矩阵 y1=sin(x); y2=cos(x); y3=0.002*exp(x); ...
- scala操作HBase2.0
在前面: scala:2.12 hbase:2.0.2 开发工具:IDEA 准备工作: 1.将生产上的hbase中的conf/hbase-site.xml文件拷贝到idea中的src/resource ...
- js判断类型的四种方法
typeof:使用typeof可以很方便的判断六种类型:undefined.boolean.string.number.object.function 数组和null会被判断为object类型 ins ...
- android --------- 嵌套unity出现 your hardware does not support this application,sorry!
最近遇见一个这个的问题 ,我在Android端接入Unity3D时出现的问题 问题是打开app直接弹出下面的弹框 点击ok 就退出了 遇到这样的问题 是因为libs文件夹的so文件出现了问题: 解决办 ...
- linux下NFS实战
系统环境 系统平台:CentOS release 6.8 (Final) NFS Server IP:172.16.55.6 防火墙关闭 SELinux=disabled 安装NFS程序包 1.查看系 ...
- React文档(十)表单
HTML表单元素和 React里的其他DOM元素有些不同,因为它们会保留一些内部的状态.举个例子,这个普通的表单接受唯一的name值: <form> <label> Name: ...
- CRM INBOX 结果增强功能
前段时间接到的需求:INBOX(ICCMP_INBOX)查询结果,多选后弹出选择用户的框,选择用户,带入到单据的PARTNER FUNC的工程师中,并修改单据状态. 其实标准的INBOX的Compon ...
- OpenStack 部署步骤详解(mitaka/ocata/一键部署)
正文 OpenStack作为一个由NASA(美国国家航空航天局)和Rackspace合作研发并发起的,开放源代码项目的云计算管理平台项目.具体知识我会在后面文章中做出介绍,本章主要按步骤给大家演示在C ...