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 ...
随机推荐
- npm使用国内镜像的方法
一.通过命令配置1. 命令 npm config set registry https://registry.npm.taobao.org 2. 验证命令 npm config get registr ...
- MVC _Ajax的使用【七】
一.本篇主要写的是在MVC项目中一种ajax的使用方法 1. 首先在控制器中创建两个方法,showCreate()和AddUserInfo() using System; using System. ...
- Rancher2.0中邮件通知的设置
1-邮件通知的设置-中国电信189邮箱 2-2-邮件通知的设置-腾讯免费企业邮箱 **说明:网易163邮箱.QQ邮箱没有设置成功,可能是因为邮箱设置得太安全的缘故. 参考链接: 中国电信189邮箱 ...
- django之ModelForm的用法
概述: ModelForm类是form是组件中Form的一个子类,所以,也是处理表单的,但功能要比Form类强大,而且使用方便. 步骤: 1.自定义一个类,继承ModelForm from djang ...
- 使用VUE框架搭建项目基本步骤
ps:初入Vue坑的小伙伴们,对于独立做一个项目可能不清楚需要使用哪些资源,这篇随笔希望对大家有所帮助. 第一步:参照vue的官方文档,建立一个vue的项目 # 全局安装 vue-cli $ npm ...
- 颜色(color)透明
颜色写法: 1.英文单词 backgroud-color:red: 2. #fff background-color:#fff; 3.#fefefe background-color:fefefe; ...
- 【框架】selenium网页端的基本自动化框架(四)
- webpack配置接口路径
比如在webpack.config.js中的plugins中加入 new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(' ...
- Java实验6
dbq时隔这么久我总算又来更新了 这次说说一个很好玩的类,JLabel的如何改里面字的属性 label.setFont(new Font("宋体", 0 , 15)); 这个指的是 ...
- LNMP(一)
第二十课LNMP(一) 目录 一.LNMP架构介绍 二.MySQL安装 三.PHP安装 四.Nginx介绍 五.Nginx安装 六.扩展 一.LNMP架构介绍 之前已经学习过LAMP架构,与LAMP相 ...