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 ...
随机推荐
- React项目中使用HighCharts
大家都知道BizCharts是基于react封装的一套图表工具,而HighCharts是基于jQuery的.但是由于本人对BizCharts甚是不熟,所以在react项目开发中选择了HighChart ...
- SpringMVC 拦截器HandlerInterceptor(一)
HandlerInterceptor 接口: 进入 Handler方法之前执行比如身份认证,如果认证通过表示当前用户没有登陆,需要此方法拦截不再向下执行 boolean preHandle(HttpS ...
- Windows下使用CMD命令进入和退出MySQL数据库
一.进入 1.在CMD命令窗口敲入命令 mysql -hlocalhost -uroot -p 后按回车(注意这里的"-h"."-u"."-p&quo ...
- eclipse 对 hadoop1.2.1 hdfs 文件操作
package com.hdfs; import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io ...
- MongoDB基本增删改查
一. 在Node中如何操作 MongoDB数据 1.使用官方的 mongodb 来操作:https://github.com/mongodb/node-mongodb-native 2.使用第三方 ...
- 『TensorFlow』数据读取类_data.Dataset
一.资料 参考原文: TensorFlow全新的数据读取方式:Dataset API入门教程 API接口简介: TensorFlow的数据集 二.背景 注意,在TensorFlow 1.3中,Data ...
- Spring cloud系列之Zuul配置项中sensitiveHeaders和ignoredHeaders
sensitiveHeaders:会过滤客户端请求中的和该配置项匹配的headers比如: zuul: sensitiveHeaders: X-ABC 如果客户端在发请求是带了X-ABC,那么X-AB ...
- vue组件局部与全局注册的区别
//局部注册 var mycomponent = new extend({ <!--Vue.extend()是Vue构造器的扩展,调用Vue.extend()我们将创建一个组件构造 ...
- Cookie中的sessionid与JSONP原理
一.首先说明一下cookie中的sessionid的作用. 1.cookie只是一些文本内容,多是键值对的形式,是请求头中的一部分 2.http是无连接的 知道这两点,就可以很容易的理解session ...
- linux的简单操作和安装
1.学习linux,安装的方式在你的windows上安装一个 vmware虚拟化软件(基于它可以安装各种系统) 2.公司中 会提供一个云服务器给你用 服务器ip 123.206.16.61 公网ip账 ...