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 ...
随机推荐
- [python]上传文件验证
上传文件验证 上传文件验证分为:1.文件头验证 2.文件类型验证 3.文件后缀验证 获取文件上传的二进制数据 # 获取上传文件 file = request.files.get('file') if ...
- [Database] Oracle 中的where 可以后接group by
SELECT e.DEPTNO,COUNT(e.EMPNO) FROM emp e WHERE e.DEPTNO=10 GROUP BY e.DEPTNO
- week7 ls
week7 ls 实现ls: 实现ls -l:
- script利用src引用外部js文件,如果内部嵌套了js代码呢
<script src='test.js' defer async> var a = 5; </script> 这个时候 var a = 5;会被忽略.
- selenium java 文件上传、下载
1.webdriver对页面文件的下载 我们一般操作浏览器下载时会让我们选择下载的目录然后经过一系列操作后才进行文件下载操作,但是用webdriver不能按这样的方式操作.经过查询资料找到了如下的实现 ...
- 菜鸟脱壳之脱壳的基础知识(二) ——DUMP的原理
菜鸟脱壳之脱壳的基础知识(二)——DUMP的原理当外壳的执行完毕后,会跳到原来的程序的入口点,即Entry Point,也可以称作OEP!当一般加密强度不是很大的壳,会在壳的末尾有一个大的跨段,跳向O ...
- PAT 1073 Scientific Notation
1073 Scientific Notation (20 分) Scientific notation is the way that scientists easily handle very ...
- YAML基础语法
正如YAML所表示的YAML Ain’t Markup Language,YAML 是一种简洁的非标记语言.YAML以数据为中心,使用空白,缩进,分行组织数据,从而使得表示更加简洁易读. 一边学习规则 ...
- .net core部署到Ubuntu
1.使用vs2017创建Asp.net Core Web应用程序,选择ubuntu中安装的.net core版本,这里选择2.1版本: 2.右键发布该项目,选择文件系统发布: 3.在ubuntu中安装 ...
- GDAL源码编译(32位)
GDAL源码编译(32位) 前言 GDAL:GDAL/OGR 是一个地理空间数据的格式转换及处理工具.官网:https://www.gdal.org/ swig:SWIG是个帮助使用C或者C++编写的 ...