dockerfile制造镜像,镜像营造

By admin in 美高梅手机版4858 on 2019年4月14日

Dockerfile 语法

一.从远程仓库中pull centos镜像

一、镜像的创设有手动与机关格局,那里大家介绍自动化的营造格局,dockerfile常用命令如下

docker创设镜像的章程:  commit、dockerfile

  1.ADD

   
 ADD命令有四个参数,源和指标。它的基本作用是从源系统的文件系统上复制文件到指标容器的文件系统。若是源是2个U牧马人L,那该UHighlanderL的始末将被下载并复制到容器中

  1. ADD /my_app_folder /my_app_folder 

 

docker pull centos

美高梅手机版4858 1

  1、使用commit来创设镜像:

 2.ENTRYPOINT

   
配置容器运维后实施的指令,并且不可被 docker run 提供的参数覆盖,各种 Dockerfile 中只可以有四个 ENTQX56YPOINT,当内定八个时,只有最终叁个起效。

  

贰.查询镜像

2、营造指令build

    commit是依照原有镜像基础上创设的镜像,使用此措施创设镜像的目标:保存镜像里的壹些安顿新闻和修改的信息。约等于三个镜像的快速照相。

3.ENV 

 
 ENV命令用于安装环境变量。那么些变量以”key=value”的款式存在,并能够在容器内被剧本或然程序调用。那一个机制给在容器中运转应用带来了非常大的福利。  

      ENV PATH /usr/local/nginx/sbin:$PATH

docker images

Usage: docker image build [OPTIONS] PATH | URL | –
Options:
-t, –tag list # 镜像名称
-f, –file string # 钦定Dockerfile文件地点

  二、使用dockerfile来塑造镜像:

4.EXPOSE 

   EXPOSE用来钦赐端口,使容器内的运用能够经过端口和外界交互。 

EXPOSE 80

美高梅手机版4858 2美高梅手机版4858 3

dockerfile制造镜像,镜像营造。示例:
docker build .
docker build -t shykes/myapp .
docker build -t shykes/myapp -f /path/Dockerfile /path

    dockerfile是火速营造所需(自定义)镜像。

5.FROM 

  这么些命令用于评释小编,并应该置身FROM的末尾。   

    MAINTAINER authors_name 

三.下载nginx和pcre到地点目录下

 


6.RUN

美高梅手机版4858 4美高梅手机版4858 5

三、nginx实例塑造,完整创设进程如下

dockerfile的指令:

7.USER

  USERAV4命令用于安装运行容器的UID。

 

4.编辑Dockerfile文件

  1 [root@centos05 nginx]# pwd
  2 /root/nginx
  3 [root@centos05 nginx]# tree
  4 .
  5 ├── Dockerfile
  6 ├── nginx-1.12.1.tar.gz
  7 └── nginx.conf
  8 
  9 0 directories, 3 files
 10 [root@centos05 nginx]# docker build -t nginx:v1 .
 11 Sending build context to Docker daemon  985.6kB
 12 Step 1/10 : FROM centos:7
 13 7: Pulling from library/centos
 14 af4b0a2388c6: Pull complete 
 15 Digest: sha256:2671f7a3eea36ce43609e9fe7435ade83094291055f1c96d9d1d1d7c0b986a5d
 16 Status: Downloaded newer image for centos:7
 17  ---> ff426288ea90
 18 Step 2/10 : MAINTAINER 1335120568@qq.com
 19  ---> Running in af4d4057b169
 20  ---> 3b371196cfa8
 21 Removing intermediate container af4d4057b169
 22 Step 3/10 : RUN yum  install -y gcc gcc-c++ make openssl-devel  pcre-devel
 23  ---> Running in 29031d7c9247
 24 Loaded plugins: fastestmirror, ovl
 25 Determining fastest mirrors
 26  * base: mirror.bit.edu.cn
 27  * extras: mirror.bit.edu.cn
 28  * updates: mirrors.tuna.tsinghua.edu.cn
 29 Resolving Dependencies
 30 --> Running transaction check
 31 ---> Package gcc.x86_64 0:4.8.5-16.el7_4.1 will be installed
 32 --> Processing Dependency: libgomp = 4.8.5-16.el7_4.1 for package: gcc-4.8.5-16.el7_4.1.x86_64
 33 --> Processing Dependency: cpp = 4.8.5-16.el7_4.1 for package: gcc-4.8.5-16.el7_4.1.x86_64
 34 --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-16.el7_4.1.x86_64
 35 --> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-16.el7_4.1.x86_64
 36 --> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-16.el7_4.1.x86_64
 37 --> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.8.5-16.el7_4.1.x86_64
 38 ---> Package gcc-c++.x86_64 0:4.8.5-16.el7_4.1 will be installed
 39 --> Processing Dependency: libstdc++-devel = 4.8.5-16.el7_4.1 for package: gcc-c++-4.8.5-16.el7_4.1.x86_64
 40 ---> Package make.x86_64 1:3.82-23.el7 will be installed
 41 ---> Package openssl-devel.x86_64 1:1.0.2k-8.el7 will be installed
 42 --> Processing Dependency: zlib-devel(x86-64) for package: 1:openssl-devel-1.0.2k-8.el7.x86_64
 43 --> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.2k-8.el7.x86_64
 44 ---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
 45 --> Running transaction check
 46 ---> Package cpp.x86_64 0:4.8.5-16.el7_4.1 will be installed
 47 ---> Package glibc-devel.x86_64 0:2.17-196.el7_4.2 will be installed
 48 --> Processing Dependency: glibc-headers = 2.17-196.el7_4.2 for package: glibc-devel-2.17-196.el7_4.2.x86_64
 49 --> Processing Dependency: glibc-headers for package: glibc-devel-2.17-196.el7_4.2.x86_64
 50 ---> Package krb5-devel.x86_64 0:1.15.1-8.el7 will be installed
 51 --> Processing Dependency: libkadm5(x86-64) = 1.15.1-8.el7 for package: krb5-devel-1.15.1-8.el7.x86_64
 52 --> Processing Dependency: libverto-devel for package: krb5-devel-1.15.1-8.el7.x86_64
 53 --> Processing Dependency: libselinux-devel for package: krb5-devel-1.15.1-8.el7.x86_64
 54 --> Processing Dependency: libcom_err-devel for package: krb5-devel-1.15.1-8.el7.x86_64
 55 --> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.15.1-8.el7.x86_64
 56 ---> Package libgomp.x86_64 0:4.8.5-16.el7_4.1 will be installed
 57 ---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
 58 ---> Package libstdc++-devel.x86_64 0:4.8.5-16.el7_4.1 will be installed
 59 ---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
 60 ---> Package zlib-devel.x86_64 0:1.2.7-17.el7 will be installed
 61 --> Running transaction check
 62 ---> Package glibc-headers.x86_64 0:2.17-196.el7_4.2 will be installed
 63 --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-196.el7_4.2.x86_64
 64 --> Processing Dependency: kernel-headers for package: glibc-headers-2.17-196.el7_4.2.x86_64
 65 ---> Package keyutils-libs-devel.x86_64 0:1.5.8-3.el7 will be installed
 66 ---> Package libcom_err-devel.x86_64 0:1.42.9-10.el7 will be installed
 67 ---> Package libkadm5.x86_64 0:1.15.1-8.el7 will be installed
 68 ---> Package libselinux-devel.x86_64 0:2.5-11.el7 will be installed
 69 --> Processing Dependency: libsepol-devel(x86-64) >= 2.5-6 for package: libselinux-devel-2.5-11.el7.x86_64
 70 --> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.5-11.el7.x86_64
 71 ---> Package libverto-devel.x86_64 0:0.2.5-4.el7 will be installed
 72 --> Running transaction check
 73 ---> Package kernel-headers.x86_64 0:3.10.0-693.11.6.el7 will be installed
 74 ---> Package libsepol-devel.x86_64 0:2.5-6.el7 will be installed
 75 --> Finished Dependency Resolution
 76 
 77 Dependencies Resolved
 78 
 79 ================================================================================
 80  Package                 Arch       Version                   Repository   Size
 81 ================================================================================
 82 Installing:
 83  gcc                     x86_64     4.8.5-16.el7_4.1          updates      16 M
 84  gcc-c++                 x86_64     4.8.5-16.el7_4.1          updates     7.2 M
 85  make                    x86_64     1:3.82-23.el7             base        420 k
 86  openssl-devel           x86_64     1:1.0.2k-8.el7            base        1.5 M
 87  pcre-devel              x86_64     8.32-17.el7               base        480 k
 88 Installing for dependencies:
 89  cpp                     x86_64     4.8.5-16.el7_4.1          updates     5.9 M
 90  glibc-devel             x86_64     2.17-196.el7_4.2          updates     1.1 M
 91  glibc-headers           x86_64     2.17-196.el7_4.2          updates     676 k
 92  kernel-headers          x86_64     3.10.0-693.11.6.el7       updates     6.0 M
 93  keyutils-libs-devel     x86_64     1.5.8-3.el7               base         37 k
 94  krb5-devel              x86_64     1.15.1-8.el7              base        266 k
 95  libcom_err-devel        x86_64     1.42.9-10.el7             base         31 k
 96  libgomp                 x86_64     4.8.5-16.el7_4.1          updates     154 k
 97  libkadm5                x86_64     1.15.1-8.el7              base        174 k
 98  libmpc                  x86_64     1.0.1-3.el7               base         51 k
 99  libselinux-devel        x86_64     2.5-11.el7                base        186 k
100  libsepol-devel          x86_64     2.5-6.el7                 base         74 k
101  libstdc++-devel         x86_64     4.8.5-16.el7_4.1          updates     1.5 M
102  libverto-devel          x86_64     0.2.5-4.el7               base         12 k
103  mpfr                    x86_64     3.1.1-4.el7               base        203 k
104  zlib-devel              x86_64     1.2.7-17.el7              base         50 k
105 
106 Transaction Summary
107 ================================================================================
108 Install  5 Packages (+16 Dependent packages)
109 
110 Total download size: 42 M
111 Installed size: 91 M
112 Downloading packages:
113 Public key for glibc-devel-2.17-196.el7_4.2.x86_64.rpm is not installed
114 warning: /var/cache/yum/x86_64/7/updates/packages/glibc-devel-2.17-196.el7_4.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
115 Public key for keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm is not installed
116 warning: /var/cache/yum/x86_64/7/updates/packages/glibc-devel-2.17-196.el7_4.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
117 Public key for keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm is not installed
118 --------------------------------------------------------------------------------
119 Total                                              976 kB/s |  42 MB  00:44     
120 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
121 Importing GPG key 0xF4A80EB5:
122  Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
123  Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
124  Package    : centos-release-7-4.1708.el7.centos.x86_64 (@CentOS)
125  From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
126 Running transaction check
127 Running transaction test
128 Transaction test succeeded
129 Running transaction
130   Installing : mpfr-3.1.1-4.el7.x86_64                                     1/21 
131   Installing : libmpc-1.0.1-3.el7.x86_64                                   2/21 
132   Installing : cpp-4.8.5-16.el7_4.1.x86_64                                 3/21 
133   Installing : libkadm5-1.15.1-8.el7.x86_64                                4/21 
134   Installing : kernel-headers-3.10.0-693.11.6.el7.x86_64                   5/21 
135   Installing : glibc-headers-2.17-196.el7_4.2.x86_64                       6/21 
136   Installing : glibc-devel-2.17-196.el7_4.2.x86_64                         7/21 
137   Installing : libsepol-devel-2.5-6.el7.x86_64                             8/21 
138   Installing : libgomp-4.8.5-16.el7_4.1.x86_64                             9/21 
139   Installing : gcc-4.8.5-16.el7_4.1.x86_64                                10/21 
140   Installing : zlib-devel-1.2.7-17.el7.x86_64                             11/21 
141   Installing : pcre-devel-8.32-17.el7.x86_64                              12/21 
142   Installing : libselinux-devel-2.5-11.el7.x86_64                         13/21 
143   Installing : libcom_err-devel-1.42.9-10.el7.x86_64                      14/21 
144   Installing : libverto-devel-0.2.5-4.el7.x86_64                          15/21 
145   Installing : keyutils-libs-devel-1.5.8-3.el7.x86_64                     16/21 
146   Installing : krb5-devel-1.15.1-8.el7.x86_64                             17/21 
147   Installing : libstdc++-devel-4.8.5-16.el7_4.1.x86_64                    18/21 
148   Installing : gcc-c++-4.8.5-16.el7_4.1.x86_64                            19/21 
149   Installing : 1:openssl-devel-1.0.2k-8.el7.x86_64                        20/21 
150   Installing : 1:make-3.82-23.el7.x86_64                                  21/21 
151   Verifying  : cpp-4.8.5-16.el7_4.1.x86_64                                 1/21 
152   Verifying  : glibc-devel-2.17-196.el7_4.2.x86_64                         2/21 
153   Verifying  : libstdc++-devel-4.8.5-16.el7_4.1.x86_64                     3/21 
154   Verifying  : keyutils-libs-devel-1.5.8-3.el7.x86_64                      4/21 
155   Verifying  : libverto-devel-0.2.5-4.el7.x86_64                           5/21 
156   Verifying  : libselinux-devel-2.5-11.el7.x86_64                          6/21 
157   Verifying  : krb5-devel-1.15.1-8.el7.x86_64                              7/21 
158   Verifying  : libcom_err-devel-1.42.9-10.el7.x86_64                       8/21 
159   Verifying  : gcc-c++-4.8.5-16.el7_4.1.x86_64                             9/21 
160   Verifying  : mpfr-3.1.1-4.el7.x86_64                                    10/21 
161   Verifying  : pcre-devel-8.32-17.el7.x86_64                              11/21 
162   Verifying  : zlib-devel-1.2.7-17.el7.x86_64                             12/21 
163   Verifying  : libgomp-4.8.5-16.el7_4.1.x86_64                            13/21 
164   Verifying  : 1:make-3.82-23.el7.x86_64                                  14/21 
165   Verifying  : libmpc-1.0.1-3.el7.x86_64                                  15/21 
166   Verifying  : libsepol-devel-2.5-6.el7.x86_64                            16/21 
167   Verifying  : kernel-headers-3.10.0-693.11.6.el7.x86_64                  17/21 
168   Verifying  : 1:openssl-devel-1.0.2k-8.el7.x86_64                        18/21 
169   Verifying  : glibc-headers-2.17-196.el7_4.2.x86_64                      19/21 
170   Verifying  : gcc-4.8.5-16.el7_4.1.x86_64                                20/21 
171   Verifying  : libkadm5-1.15.1-8.el7.x86_64                               21/21 
172 
173 Installed:
174   gcc.x86_64 0:4.8.5-16.el7_4.1        gcc-c++.x86_64 0:4.8.5-16.el7_4.1       
175   make.x86_64 1:3.82-23.el7            openssl-devel.x86_64 1:1.0.2k-8.el7     
176   pcre-devel.x86_64 0:8.32-17.el7     
177 
178 Dependency Installed:
179   cpp.x86_64 0:4.8.5-16.el7_4.1                                                 
180   glibc-devel.x86_64 0:2.17-196.el7_4.2                                         
181   glibc-headers.x86_64 0:2.17-196.el7_4.2                                       
182   kernel-headers.x86_64 0:3.10.0-693.11.6.el7                                   
183   keyutils-libs-devel.x86_64 0:1.5.8-3.el7                                      
184   krb5-devel.x86_64 0:1.15.1-8.el7                                              
185   libcom_err-devel.x86_64 0:1.42.9-10.el7                                       
186   libgomp.x86_64 0:4.8.5-16.el7_4.1                                             
187   libkadm5.x86_64 0:1.15.1-8.el7                                                
188   libmpc.x86_64 0:1.0.1-3.el7                                                   
189   libselinux-devel.x86_64 0:2.5-11.el7                                          
190   libsepol-devel.x86_64 0:2.5-6.el7                                             
191   libstdc++-devel.x86_64 0:4.8.5-16.el7_4.1                                     
192   libverto-devel.x86_64 0:0.2.5-4.el7                                           
193   mpfr.x86_64 0:3.1.1-4.el7                                                     
194   zlib-devel.x86_64 0:1.2.7-17.el7                                              
195 
196 Complete!
197  ---> 929518dfe4a3
198 Removing intermediate container 29031d7c9247
199 Step 4/10 : ADD nginx-1.12.1.tar.gz /tmp
200  ---> 3327512c6204
201 Step 5/10 : RUN cd /tmp/nginx-1.12.1 &&     ./configure --prefix=/usr/local/nginx &&     make && make install
202  ---> Running in 048ad6f78b44
203 checking for OS
204  + Linux 3.10.0-693.el7.x86_64 x86_64
205 checking for C compiler ... found
206  + using GNU C compiler
207  + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
208 checking for gcc -pipe switch ... found
209 checking for -Wl,-E switch ... found
210 checking for gcc builtin atomic operations ... found
211 checking for C99 variadic macros ... found
212 checking for gcc variadic macros ... found
213 checking for gcc builtin 64 bit byteswap ... found
214 checking for unistd.h ... found
215 checking for inttypes.h ... found
216 checking for limits.h ... found
217 checking for sys/filio.h ... not found
218 checking for sys/param.h ... found
219 checking for sys/mount.h ... found
220 checking for sys/statvfs.h ... found
221 checking for crypt.h ... found
222 checking for Linux specific features
223 checking for epoll ... found
224 checking for EPOLLRDHUP ... found
225 checking for EPOLLEXCLUSIVE ... not found
226 checking for O_PATH ... found
227 checking for sendfile() ... found
228 checking for sendfile64() ... found
229 checking for sys/prctl.h ... found
230 checking for prctl(PR_SET_DUMPABLE) ... found
231 checking for sched_setaffinity() ... found
232 checking for crypt_r() ... found
233 checking for sys/vfs.h ... found
234 checking for nobody group ... found
235 checking for poll() ... found
236 checking for /dev/poll ... not found
237 checking for kqueue ... not found
238 checking for crypt() ... not found
239 checking for crypt() in libcrypt ... found
240 checking for F_READAHEAD ... not found
241 checking for posix_fadvise() ... found
242 checking for O_DIRECT ... found
243 checking for F_NOCACHE ... not found
244 checking for directio() ... not found
245 checking for statfs() ... found
246 checking for statvfs() ... found
247 checking for dlopen() ... not found
248 checking for dlopen() in libdl ... found
249 checking for sched_yield() ... found
250 checking for SO_SETFIB ... not found
251 checking for SO_REUSEPORT ... found
252 checking for SO_ACCEPTFILTER ... not found
253 checking for SO_BINDANY ... not found
254 checking for IP_BIND_ADDRESS_NO_PORT ... not found
255 checking for IP_TRANSPARENT ... found
256 checking for IP_BINDANY ... not found
257 checking for IP_RECVDSTADDR ... not found
258 checking for IP_PKTINFO ... found
259 checking for IPV6_RECVPKTINFO ... found
260 checking for TCP_DEFER_ACCEPT ... found
261 checking for TCP_KEEPIDLE ... found
262 checking for TCP_FASTOPEN ... found
263 checking for TCP_INFO ... found
264 checking for accept4() ... found
265 checking for eventfd() ... found
266 checking for int size ... 4 bytes
267 checking for long size ... 8 bytes
268 checking for long long size ... 8 bytes
269 checking for void * size ... 8 bytes
270 checking for uint32_t ... found
271 checking for uint64_t ... found
272 checking for sig_atomic_t ... found
273 checking for sig_atomic_t size ... 4 bytes
274 checking for socklen_t ... found
275 checking for in_addr_t ... found
276 checking for in_port_t ... found
277 checking for rlim_t ... found
278 checking for uintptr_t ... uintptr_t found
279 checking for system byte ordering ... little endian
280 checking for size_t size ... 8 bytes
281 checking for off_t size ... 8 bytes
282 checking for time_t size ... 8 bytes
283 checking for AF_INET6 ... found
284 checking for setproctitle() ... not found
285 checking for pread() ... found
286 checking for pwrite() ... found
287 checking for pwritev() ... found
288 checking for sys_nerr ... found
289 checking for localtime_r() ... found
290 checking for posix_memalign() ... found
291 checking for memalign() ... found
292 checking for mmap(MAP_ANON|MAP_SHARED) ... found
293 checking for mmap("/dev/zero", MAP_SHARED) ... found
294 checking for System V shared memory ... found
295 checking for POSIX semaphores ... not found
296 checking for POSIX semaphores in libpthread ... found
297 checking for struct msghdr.msg_control ... found
298 checking for ioctl(FIONBIO) ... found
299 checking for struct tm.tm_gmtoff ... found
300 checking for struct dirent.d_namlen ... not found
301 checking for struct dirent.d_type ... found
302 checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
303 checking for openat(), fstatat() ... found
304 checking for getaddrinfo() ... found
305 checking for PCRE library ... found
306 checking for PCRE JIT support ... found
307 checking for zlib library ... found
308 creating objs/Makefile
309 
310 Configuration summary
311   + using system PCRE library
312   + OpenSSL library is not used
313   + using system zlib library
314 
315   nginx path prefix: "/usr/local/nginx"
316   nginx binary file: "/usr/local/nginx/sbin/nginx"
317   nginx modules path: "/usr/local/nginx/modules"
318   nginx configuration prefix: "/usr/local/nginx/conf"
319   nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
320   nginx pid file: "/usr/local/nginx/logs/nginx.pid"
321   nginx error log file: "/usr/local/nginx/logs/error.log"
322   nginx http access log file: "/usr/local/nginx/logs/access.log"
323   nginx http client request body temporary files: "client_body_temp"
324   nginx http proxy temporary files: "proxy_temp"
325   nginx http fastcgi temporary files: "fastcgi_temp"
326   nginx http uwsgi temporary files: "uwsgi_temp"
327   nginx http scgi temporary files: "scgi_temp"
328 
329 make -f objs/Makefile
330 make[1]: Entering directory `/tmp/nginx-1.12.1'
331 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
332     -o objs/src/core/nginx.o \
333     src/core/nginx.c
334 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
335     -o objs/src/core/ngx_log.o \
336     src/core/ngx_log.c
337 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
338     -o objs/src/core/ngx_palloc.o \
339     src/core/ngx_palloc.c
340 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
341     -o objs/src/core/ngx_array.o \
342     src/core/ngx_array.c
343 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
344     -o objs/src/core/ngx_list.o \
345     src/core/ngx_list.c
346 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
347     -o objs/src/core/ngx_hash.o \
348     src/core/ngx_hash.c
349 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
350     -o objs/src/core/ngx_buf.o \
351     src/core/ngx_buf.c
352 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
353     -o objs/src/core/ngx_queue.o \
354     src/core/ngx_queue.c
355 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
356     -o objs/src/core/ngx_output_chain.o \
357     src/core/ngx_output_chain.c
358 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
359     -o objs/src/core/ngx_string.o \
360     src/core/ngx_string.c
361 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
362     -o objs/src/core/ngx_parse.o \
363     src/core/ngx_parse.c
364 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
365     -o objs/src/core/ngx_parse_time.o \
366     src/core/ngx_parse_time.c
367 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
368     -o objs/src/core/ngx_inet.o \
369     src/core/ngx_inet.c
370 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
371     -o objs/src/core/ngx_file.o \
372     src/core/ngx_file.c
373 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
374     -o objs/src/core/ngx_crc32.o \
375     src/core/ngx_crc32.c
376 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
377     -o objs/src/core/ngx_murmurhash.o \
378     src/core/ngx_murmurhash.c
379 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
380     -o objs/src/core/ngx_md5.o \
381     src/core/ngx_md5.c
382 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
383     -o objs/src/core/ngx_sha1.o \
384     src/core/ngx_sha1.c
385 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
386     -o objs/src/core/ngx_rbtree.o \
387     src/core/ngx_rbtree.c
388 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
389     -o objs/src/core/ngx_radix_tree.o \
390     src/core/ngx_radix_tree.c
391 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
392     -o objs/src/core/ngx_slab.o \
393     src/core/ngx_slab.c
394 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
395     -o objs/src/core/ngx_times.o \
396     src/core/ngx_times.c
397 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
398     -o objs/src/core/ngx_shmtx.o \
399     src/core/ngx_shmtx.c
400 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
401     -o objs/src/core/ngx_connection.o \
402     src/core/ngx_connection.c
403 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
404     -o objs/src/core/ngx_cycle.o \
405     src/core/ngx_cycle.c
406 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
407     -o objs/src/core/ngx_spinlock.o \
408     src/core/ngx_spinlock.c
409 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
410     -o objs/src/core/ngx_rwlock.o \
411     src/core/ngx_rwlock.c
412 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
413     -o objs/src/core/ngx_cpuinfo.o \
414     src/core/ngx_cpuinfo.c
415 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
416     -o objs/src/core/ngx_conf_file.o \
417     src/core/ngx_conf_file.c
418 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
419     -o objs/src/core/ngx_module.o \
420     src/core/ngx_module.c
421 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
422     -o objs/src/core/ngx_resolver.o \
423     src/core/ngx_resolver.c
424 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
425     -o objs/src/core/ngx_open_file_cache.o \
426     src/core/ngx_open_file_cache.c
427 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
428     -o objs/src/core/ngx_crypt.o \
429     src/core/ngx_crypt.c
430 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
431     -o objs/src/core/ngx_proxy_protocol.o \
432     src/core/ngx_proxy_protocol.c
433 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
434     -o objs/src/core/ngx_syslog.o \
435     src/core/ngx_syslog.c
436 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
437     -o objs/src/event/ngx_event.o \
438     src/event/ngx_event.c
439 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
440     -o objs/src/event/ngx_event_timer.o \
441     src/event/ngx_event_timer.c
442 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
443     -o objs/src/event/ngx_event_posted.o \
444     src/event/ngx_event_posted.c
445 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
446     -o objs/src/event/ngx_event_accept.o \
447     src/event/ngx_event_accept.c
448 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
449     -o objs/src/event/ngx_event_connect.o \
450     src/event/ngx_event_connect.c
451 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
452     -o objs/src/event/ngx_event_pipe.o \
453     src/event/ngx_event_pipe.c
454 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
455     -o objs/src/os/unix/ngx_time.o \
456     src/os/unix/ngx_time.c
457 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
458     -o objs/src/os/unix/ngx_errno.o \
459     src/os/unix/ngx_errno.c
460 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
461     -o objs/src/os/unix/ngx_alloc.o \
462     src/os/unix/ngx_alloc.c
463 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
464     -o objs/src/os/unix/ngx_files.o \
465     src/os/unix/ngx_files.c
466 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
467     -o objs/src/os/unix/ngx_socket.o \
468     src/os/unix/ngx_socket.c
469 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
470     -o objs/src/os/unix/ngx_recv.o \
471     src/os/unix/ngx_recv.c
472 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
473     -o objs/src/os/unix/ngx_readv_chain.o \
474     src/os/unix/ngx_readv_chain.c
475 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
476     -o objs/src/os/unix/ngx_udp_recv.o \
477     src/os/unix/ngx_udp_recv.c
478 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
479     -o objs/src/os/unix/ngx_send.o \
480     src/os/unix/ngx_send.c
481 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
482     -o objs/src/os/unix/ngx_writev_chain.o \
483     src/os/unix/ngx_writev_chain.c
484 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
485     -o objs/src/os/unix/ngx_udp_send.o \
486     src/os/unix/ngx_udp_send.c
487 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
488     -o objs/src/os/unix/ngx_udp_sendmsg_chain.o \
489     src/os/unix/ngx_udp_sendmsg_chain.c
490 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
491     -o objs/src/os/unix/ngx_channel.o \
492     src/os/unix/ngx_channel.c
493 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
494     -o objs/src/os/unix/ngx_shmem.o \
495     src/os/unix/ngx_shmem.c
496 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
497     -o objs/src/os/unix/ngx_process.o \
498     src/os/unix/ngx_process.c
499 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
500     -o objs/src/os/unix/ngx_daemon.o \
501     src/os/unix/ngx_daemon.c
502 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
503     -o objs/src/os/unix/ngx_setaffinity.o \
504     src/os/unix/ngx_setaffinity.c
505 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
506     -o objs/src/os/unix/ngx_setproctitle.o \
507     src/os/unix/ngx_setproctitle.c
508 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
509     -o objs/src/os/unix/ngx_posix_init.o \
510     src/os/unix/ngx_posix_init.c
511 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
512     -o objs/src/os/unix/ngx_user.o \
513     src/os/unix/ngx_user.c
514 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
515     -o objs/src/os/unix/ngx_dlopen.o \
516     src/os/unix/ngx_dlopen.c
517 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
518     -o objs/src/os/unix/ngx_process_cycle.o \
519     src/os/unix/ngx_process_cycle.c
520 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
521     -o objs/src/os/unix/ngx_linux_init.o \
522     src/os/unix/ngx_linux_init.c
523 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
524     -o objs/src/event/modules/ngx_epoll_module.o \
525     src/event/modules/ngx_epoll_module.c
526 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
527     -o objs/src/os/unix/ngx_linux_sendfile_chain.o \
528     src/os/unix/ngx_linux_sendfile_chain.c
529 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
530     -o objs/src/core/ngx_regex.o \
531     src/core/ngx_regex.c
532 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
533     -o objs/src/http/ngx_http.o \
534     src/http/ngx_http.c
535 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
536     -o objs/src/http/ngx_http_core_module.o \
537     src/http/ngx_http_core_module.c
538 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
539     -o objs/src/http/ngx_http_special_response.o \
540     src/http/ngx_http_special_response.c
541 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
542     -o objs/src/http/ngx_http_request.o \
543     src/http/ngx_http_request.c
544 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
545     -o objs/src/http/ngx_http_parse.o \
546     src/http/ngx_http_parse.c
547 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
548     -o objs/src/http/modules/ngx_http_log_module.o \
549     src/http/modules/ngx_http_log_module.c
550 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
551     -o objs/src/http/ngx_http_request_body.o \
552     src/http/ngx_http_request_body.c
553 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
554     -o objs/src/http/ngx_http_variables.o \
555     src/http/ngx_http_variables.c
556 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
557     -o objs/src/http/ngx_http_script.o \
558     src/http/ngx_http_script.c
559 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
560     -o objs/src/http/ngx_http_upstream.o \
561     src/http/ngx_http_upstream.c
562 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
563     -o objs/src/http/ngx_http_upstream_round_robin.o \
564     src/http/ngx_http_upstream_round_robin.c
565 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
566     -o objs/src/http/ngx_http_file_cache.o \
567     src/http/ngx_http_file_cache.c
568 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
569     -o objs/src/http/ngx_http_write_filter_module.o \
570     src/http/ngx_http_write_filter_module.c
571 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
572     -o objs/src/http/ngx_http_header_filter_module.o \
573     src/http/ngx_http_header_filter_module.c
574 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
575     -o objs/src/http/modules/ngx_http_chunked_filter_module.o \
576     src/http/modules/ngx_http_chunked_filter_module.c
577 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
578     -o objs/src/http/modules/ngx_http_range_filter_module.o \
579     src/http/modules/ngx_http_range_filter_module.c
580 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
581     -o objs/src/http/modules/ngx_http_gzip_filter_module.o \
582     src/http/modules/ngx_http_gzip_filter_module.c
583 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
584     -o objs/src/http/ngx_http_postpone_filter_module.o \
585     src/http/ngx_http_postpone_filter_module.c
586 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
587     -o objs/src/http/modules/ngx_http_ssi_filter_module.o \
588     src/http/modules/ngx_http_ssi_filter_module.c
589 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
590     -o objs/src/http/modules/ngx_http_charset_filter_module.o \
591     src/http/modules/ngx_http_charset_filter_module.c
592 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
593     -o objs/src/http/modules/ngx_http_userid_filter_module.o \
594     src/http/modules/ngx_http_userid_filter_module.c
595 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
596     -o objs/src/http/modules/ngx_http_headers_filter_module.o \
597     src/http/modules/ngx_http_headers_filter_module.c
598 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
599     -o objs/src/http/ngx_http_copy_filter_module.o \
600     src/http/ngx_http_copy_filter_module.c
601 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
602     -o objs/src/http/modules/ngx_http_not_modified_filter_module.o \
603     src/http/modules/ngx_http_not_modified_filter_module.c
604 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
605     -o objs/src/http/modules/ngx_http_static_module.o \
606     src/http/modules/ngx_http_static_module.c
607 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
608     -o objs/src/http/modules/ngx_http_autoindex_module.o \
609     src/http/modules/ngx_http_autoindex_module.c
610 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
611     -o objs/src/http/modules/ngx_http_index_module.o \
612     src/http/modules/ngx_http_index_module.c
613 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
614     -o objs/src/http/modules/ngx_http_auth_basic_module.o \
615     src/http/modules/ngx_http_auth_basic_module.c
616 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
617     -o objs/src/http/modules/ngx_http_access_module.o \
618     src/http/modules/ngx_http_access_module.c
619 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
620     -o objs/src/http/modules/ngx_http_limit_conn_module.o \
621     src/http/modules/ngx_http_limit_conn_module.c
622 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
623     -o objs/src/http/modules/ngx_http_limit_req_module.o \
624     src/http/modules/ngx_http_limit_req_module.c
625 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
626     -o objs/src/http/modules/ngx_http_geo_module.o \
627     src/http/modules/ngx_http_geo_module.c
628 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
629     -o objs/src/http/modules/ngx_http_map_module.o \
630     src/http/modules/ngx_http_map_module.c
631 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
632     -o objs/src/http/modules/ngx_http_split_clients_module.o \
633     src/http/modules/ngx_http_split_clients_module.c
634 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
635     -o objs/src/http/modules/ngx_http_referer_module.o \
636     src/http/modules/ngx_http_referer_module.c
637 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
638     -o objs/src/http/modules/ngx_http_rewrite_module.o \
639     src/http/modules/ngx_http_rewrite_module.c
640 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
641     -o objs/src/http/modules/ngx_http_proxy_module.o \
642     src/http/modules/ngx_http_proxy_module.c
643 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
644     -o objs/src/http/modules/ngx_http_fastcgi_module.o \
645     src/http/modules/ngx_http_fastcgi_module.c
646 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
647     -o objs/src/http/modules/ngx_http_uwsgi_module.o \
648     src/http/modules/ngx_http_uwsgi_module.c
649 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
650     -o objs/src/http/modules/ngx_http_scgi_module.o \
651     src/http/modules/ngx_http_scgi_module.c
652 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
653     -o objs/src/http/modules/ngx_http_memcached_module.o \
654     src/http/modules/ngx_http_memcached_module.c
655 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
656     -o objs/src/http/modules/ngx_http_empty_gif_module.o \
657     src/http/modules/ngx_http_empty_gif_module.c
658 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
659     -o objs/src/http/modules/ngx_http_browser_module.o \
660     src/http/modules/ngx_http_browser_module.c
661 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
662     -o objs/src/http/modules/ngx_http_upstream_hash_module.o \
663     src/http/modules/ngx_http_upstream_hash_module.c
664 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
665     -o objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
666     src/http/modules/ngx_http_upstream_ip_hash_module.c
667 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
668     -o objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
669     src/http/modules/ngx_http_upstream_least_conn_module.c
670 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
671     -o objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
672     src/http/modules/ngx_http_upstream_keepalive_module.c
673 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
674     -o objs/src/http/modules/ngx_http_upstream_zone_module.o \
675     src/http/modules/ngx_http_upstream_zone_module.c
676 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
677     -o objs/ngx_modules.o \
678     objs/ngx_modules.c
679 cc -o objs/nginx \
680 objs/src/core/nginx.o \
681 objs/src/core/ngx_log.o \
682 objs/src/core/ngx_palloc.o \
683 objs/src/core/ngx_array.o \
684 objs/src/core/ngx_list.o \
685 objs/src/core/ngx_hash.o \
686 objs/src/core/ngx_buf.o \
687 objs/src/core/ngx_queue.o \
688 objs/src/core/ngx_output_chain.o \
689 objs/src/core/ngx_string.o \
690 objs/src/core/ngx_parse.o \
691 objs/src/core/ngx_parse_time.o \
692 objs/src/core/ngx_inet.o \
693 objs/src/core/ngx_file.o \
694 objs/src/core/ngx_crc32.o \
695 objs/src/core/ngx_murmurhash.o \
696 objs/src/core/ngx_md5.o \
697 objs/src/core/ngx_sha1.o \
698 objs/src/core/ngx_rbtree.o \
699 objs/src/core/ngx_radix_tree.o \
700 objs/src/core/ngx_slab.o \
701 objs/src/core/ngx_times.o \
702 objs/src/core/ngx_shmtx.o \
703 objs/src/core/ngx_connection.o \
704 objs/src/core/ngx_cycle.o \
705 objs/src/core/ngx_spinlock.o \
706 objs/src/core/ngx_rwlock.o \
707 objs/src/core/ngx_cpuinfo.o \
708 objs/src/core/ngx_conf_file.o \
709 objs/src/core/ngx_module.o \
710 objs/src/core/ngx_resolver.o \
711 objs/src/core/ngx_open_file_cache.o \
712 objs/src/core/ngx_crypt.o \
713 objs/src/core/ngx_proxy_protocol.o \
714 objs/src/core/ngx_syslog.o \
715 objs/src/event/ngx_event.o \
716 objs/src/event/ngx_event_timer.o \
717 objs/src/event/ngx_event_posted.o \
718 objs/src/event/ngx_event_accept.o \
719 objs/src/event/ngx_event_connect.o \
720 objs/src/event/ngx_event_pipe.o \
721 objs/src/os/unix/ngx_time.o \
722 objs/src/os/unix/ngx_errno.o \
723 objs/src/os/unix/ngx_alloc.o \
724 objs/src/os/unix/ngx_files.o \
725 objs/src/os/unix/ngx_socket.o \
726 objs/src/os/unix/ngx_recv.o \
727 objs/src/os/unix/ngx_readv_chain.o \
728 objs/src/os/unix/ngx_udp_recv.o \
729 objs/src/os/unix/ngx_send.o \
730 objs/src/os/unix/ngx_writev_chain.o \
731 objs/src/os/unix/ngx_udp_send.o \
732 objs/src/os/unix/ngx_udp_sendmsg_chain.o \
733 objs/src/os/unix/ngx_channel.o \
734 objs/src/os/unix/ngx_shmem.o \
735 objs/src/os/unix/ngx_process.o \
736 objs/src/os/unix/ngx_daemon.o \
737 objs/src/os/unix/ngx_setaffinity.o \
738 objs/src/os/unix/ngx_setproctitle.o \
739 objs/src/os/unix/ngx_posix_init.o \
740 objs/src/os/unix/ngx_user.o \
741 objs/src/os/unix/ngx_dlopen.o \
742 objs/src/os/unix/ngx_process_cycle.o \
743 objs/src/os/unix/ngx_linux_init.o \
744 objs/src/event/modules/ngx_epoll_module.o \
745 objs/src/os/unix/ngx_linux_sendfile_chain.o \
746 objs/src/core/ngx_regex.o \
747 objs/src/http/ngx_http.o \
748 objs/src/http/ngx_http_core_module.o \
749 objs/src/http/ngx_http_special_response.o \
750 objs/src/http/ngx_http_request.o \
751 objs/src/http/ngx_http_parse.o \
752 objs/src/http/modules/ngx_http_log_module.o \
753 objs/src/http/ngx_http_request_body.o \
754 objs/src/http/ngx_http_variables.o \
755 objs/src/http/ngx_http_script.o \
756 objs/src/http/ngx_http_upstream.o \
757 objs/src/http/ngx_http_upstream_round_robin.o \
758 objs/src/http/ngx_http_file_cache.o \
759 objs/src/http/ngx_http_write_filter_module.o \
760 objs/src/http/ngx_http_header_filter_module.o \
761 objs/src/http/modules/ngx_http_chunked_filter_module.o \
762 objs/src/http/modules/ngx_http_range_filter_module.o \
763 objs/src/http/modules/ngx_http_gzip_filter_module.o \
764 objs/src/http/ngx_http_postpone_filter_module.o \
765 objs/src/http/modules/ngx_http_ssi_filter_module.o \
766 objs/src/http/modules/ngx_http_charset_filter_module.o \
767 objs/src/http/modules/ngx_http_userid_filter_module.o \
768 objs/src/http/modules/ngx_http_headers_filter_module.o \
769 objs/src/http/ngx_http_copy_filter_module.o \
770 objs/src/http/modules/ngx_http_not_modified_filter_module.o \
771 objs/src/http/modules/ngx_http_static_module.o \
772 objs/src/http/modules/ngx_http_autoindex_module.o \
773 objs/src/http/modules/ngx_http_index_module.o \
774 objs/src/http/modules/ngx_http_auth_basic_module.o \
775 objs/src/http/modules/ngx_http_access_module.o \
776 objs/src/http/modules/ngx_http_limit_conn_module.o \
777 objs/src/http/modules/ngx_http_limit_req_module.o \
778 objs/src/http/modules/ngx_http_geo_module.o \
779 objs/src/http/modules/ngx_http_map_module.o \
780 objs/src/http/modules/ngx_http_split_clients_module.o \
781 objs/src/http/modules/ngx_http_referer_module.o \
782 objs/src/http/modules/ngx_http_rewrite_module.o \
783 objs/src/http/modules/ngx_http_proxy_module.o \
784 objs/src/http/modules/ngx_http_fastcgi_module.o \
785 objs/src/http/modules/ngx_http_uwsgi_module.o \
786 objs/src/http/modules/ngx_http_scgi_module.o \
787 objs/src/http/modules/ngx_http_memcached_module.o \
788 objs/src/http/modules/ngx_http_empty_gif_module.o \
789 objs/src/http/modules/ngx_http_browser_module.o \
790 objs/src/http/modules/ngx_http_upstream_hash_module.o \
791 objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
792 objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
793 objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
794 objs/src/http/modules/ngx_http_upstream_zone_module.o \
795 objs/ngx_modules.o \
796 -ldl -lpthread -lcrypt -lpcre -lz \
797 -Wl,-E
798 sed -e "s|%%PREFIX%%|/usr/local/nginx|" \
799     -e "s|%%PID_PATH%%|/usr/local/nginx/logs/nginx.pid|" \
800     -e "s|%%CONF_PATH%%|/usr/local/nginx/conf/nginx.conf|" \
801     -e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \
802     < man/nginx.8 > objs/nginx.8
803 make[1]: Leaving directory `/tmp/nginx-1.12.1'
804 make -f objs/Makefile install
805 make[1]: Entering directory `/tmp/nginx-1.12.1'
806 test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
807 test -d '/usr/local/nginx/sbin' \
808     || mkdir -p '/usr/local/nginx/sbin'
809 test ! -f '/usr/local/nginx/sbin/nginx' \
810     || mv '/usr/local/nginx/sbin/nginx' \
811         '/usr/local/nginx/sbin/nginx.old'
812 cp objs/nginx '/usr/local/nginx/sbin/nginx'
813 test -d '/usr/local/nginx/conf' \
814     || mkdir -p '/usr/local/nginx/conf'
815 cp conf/koi-win '/usr/local/nginx/conf'
816 cp conf/koi-utf '/usr/local/nginx/conf'
817 cp conf/win-utf '/usr/local/nginx/conf'
818 test -f '/usr/local/nginx/conf/mime.types' \
819     || cp conf/mime.types '/usr/local/nginx/conf'
820 cp conf/mime.types '/usr/local/nginx/conf/mime.types.default'
821 test -f '/usr/local/nginx/conf/fastcgi_params' \
822     || cp conf/fastcgi_params '/usr/local/nginx/conf'
823 cp conf/fastcgi_params \
824     '/usr/local/nginx/conf/fastcgi_params.default'
825 test -f '/usr/local/nginx/conf/fastcgi.conf' \
826     || cp conf/fastcgi.conf '/usr/local/nginx/conf'
827 cp conf/fastcgi.conf '/usr/local/nginx/conf/fastcgi.conf.default'
828 test -f '/usr/local/nginx/conf/uwsgi_params' \
829     || cp conf/uwsgi_params '/usr/local/nginx/conf'
830 cp conf/uwsgi_params \
831     '/usr/local/nginx/conf/uwsgi_params.default'
832 test -f '/usr/local/nginx/conf/scgi_params' \
833     || cp conf/scgi_params '/usr/local/nginx/conf'
834 cp conf/scgi_params \
835     '/usr/local/nginx/conf/scgi_params.default'
836 test -f '/usr/local/nginx/conf/nginx.conf' \
837     || cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf'
838 cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default'
839 test -d '/usr/local/nginx/logs' \
840     || mkdir -p '/usr/local/nginx/logs'
841 test -d '/usr/local/nginx/logs' \
842     || mkdir -p '/usr/local/nginx/logs'
843 test -d '/usr/local/nginx/html' \
844     || cp -R html '/usr/local/nginx'
845 test -d '/usr/local/nginx/logs' \
846     || mkdir -p '/usr/local/nginx/logs'
847 make[1]: Leaving directory `/tmp/nginx-1.12.1'
848  ---> 06a1f20e0b55
849 Removing intermediate container 048ad6f78b44
850 Step 6/10 : RUN rm -rf /tmp/nginx-1.12.1* && yum clean all
851  ---> Running in db9cd26f369a
852 Loaded plugins: fastestmirror, ovl
853 Cleaning repos: base extras updates
854 Cleaning up everything
855 Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
856 Cleaning up list of fastest mirrors
857  ---> 490b07a321e8
858 Removing intermediate container db9cd26f369a
859 Step 7/10 : COPY nginx.conf /usr/local/nginx/conf
860  ---> c14178e9bacb
861 Step 8/10 : WORKDIR /usr/local/nignx
862  ---> f5371521ecf3
863 Removing intermediate container 153b3472125d
864 Step 9/10 : EXPOSE 80
865  ---> Running in 0591f916b6cc
866  ---> e68d670c52c3
867 Removing intermediate container 0591f916b6cc
868 Step 10/10 : CMD ./sbin/nginx -g daemon off;
869  ---> Running in 07fc02543335
870  ---> 66243306e10f
871 Removing intermediate container 07fc02543335
872 Successfully built 66243306e10f
873 Successfully tagged nginx:v1

  FROM:钦点基础镜像(FROM是不能缺少的一声令下,并且必须为第3条指令)。

8.WORKDIR

  WO猎豹CS陆KDI凯雷德命令用于安装CMD指明的通令的运营目录。

 

上面就营造二个简易的dockerfile

   1.索要一个基础镜像

      docker pull centos

 
 二.在某三个目录下边创制1个专程存放此demo的目录,也便是Dockerfile所在的context:

      

[root@docker ~]# mkdir docker_demo
[root@docker ~]# cd docker_demo/
[root@docker docker_demo]# touch Dockerfile
[root@docker docker_demo]# pwd
/root/docker_demo
[root@docker docker_demo]# ll
total 0
-rw-r–r–. 1 root root 0 Nov 1 04:34 Dockerfile

 

下载nginx源码包到docker_demo那些目录下:

[root@docker docker_demo]# ll
total 960
-rw-r--r--. 1 root root      0 Nov  1 04:34 Dockerfile
-rw-r--r--. 1 root root 981687 Oct 17 09:20 nginx-1.12.2.tar.gz

以下是编写好的Dockerfile v1版:

[root@docker docker_demo]# cat Dockerfile
# base image
FROM centos
# MAINTAINER
MAINTAINER json_hc@163.com
# put nginx-1.12.2.tar.gz into /usr/local/src and unpack nginx
ADD nginx-1.12.2.tar.gz /usr/local/src
# running required command
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 -M -s /sbin/nologin nginx
# change dir to /usr/local/src/nginx-1.12.2
WORKDIR /usr/local/src/nginx-1.12.2
# execute command to compile nginx
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

EXPOSE 80

[root@docker docker_demo]# docker build -t centos_nginx:v2 .
Sending build context to Docker daemon 985.6kB
Step 1/10 : FROM centos
—> 196e0ce0c9fb
Step 2/10 : MAINTAINER json_hc@163.com
—> Using cache
—> cde1d7830106
Step 3/10 : ADD nginx-1.12.2.tar.gz /usr/local/src
—> Using cache
—> 1e4d16340af0
Step 4/10 : RUN yum install -y gcc gcc-c++ glibc make autoconf openssl
openssl-devel
—> Using cache
—> 405835ad9b0b
Step 5/10 : RUN yum install -y libxslt-devel -y gd gd-devel GeoIP
GeoIP-devel pcre pcre-devel
—> Using cache
—> 4002738cf7a6
Step 6/10 : RUN useradd -M -s /sbin/nologin nginx
—> Using cache
美高梅手机版4858 ,—> 02961c5c564d
Step 7/10 : WORKDIR /usr/local/src/nginx-1.12.2
—> Using cache
—> f1da71a93c5e
Step 8/10 : 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
—> Using cache
—> cd2ad4c45004
Step 9/10 : ENV PATH /usr/local/nginx/sbin:$PATH
—> Running in 07ba2f7129bc
—> 9588fa1058aa
Removing intermediate container 07ba2f7129bc
Step 10/10 : EXPOSE 80
—> Running in 473cd847154a
—> 2031faf8894a
Removing intermediate container 473cd847154a
Successfully built 2031faf8894a
Successfully tagged centos_nginx:v2

 

$ docker images

$ docker run -d -p81:80 centos_nginx nginx -g "daemon off;"

$ docker ps -l

最后通过浏览器访问就可以了

   

#Nginx dockerfile

 

  RUN: 用来执行命令行命令。其主干格式:

#Version 1.0

精简步骤如下

      shell格式: RUN  <命令> 
,输入在bash环境中的命令即可,二个dockerfile允许行使RUN不得超越1二七层,所以,使用1次RUN,
使用 ‘ \ ’ 换行,使用‘ && ’执行下一条命令。一般选取此种格式;

#Author: kehaojian

[root@centos05 nginx]# docker build -t nginx:v1 .
Sending build context to Docker daemon 985.6kB
Step 1/10 : FROM centos:7
—> ff426288ea90
Step 2/10 : MAINTAINER 1335120568@qq.com
—> Using cache
—> 936bb93a1c1e
Step 3/10 : RUN yum install -y gcc gcc-c++ make openssl-devel
pcre-devel
—> Using cache
—> 47148001540c
Step 4/10 : ADD nginx-1.12.1.tar.gz /tmp
—> Using cache
—> df7b9c12d4c3
Step 5/10 : RUN cd /tmp/nginx-1.12.1 && ./configure
–prefix=/usr/local/nginx && make && make install
—> Using cache
—> be894e2b22c5
Step 6/10 : RUN rm -rf /tmp/nginx-1.12.1* && yum clean all
—> Using cache
—> 388f2ddd833f
Step 7/10 : COPY nginx.conf /usr/local/nginx/conf/
—> c1a4e51e07b1
Step 8/10 : WORKDIR /usr/local/nignx
—> 88478cd55e90
Removing intermediate container bbdebfc2987c
Step 9/10 : EXPOSE 80
—> Running in cf09ebac583c
—> 64bd2315ca9a
Removing intermediate container cf09ebac583c
Step 10/10 : CMD /usr/local/nginx/sbin/nginx -g daemon off;
—> Running in 2ca6fc47bedb
—> 851d8c049e80
Removing intermediate container 2ca6fc47bedb
Successfully built 851d8c049e80
Successfully tagged nginx:v1

      exec格式: RUN  <“可执行文件”, “参数1”,
“参数2”>,此种情势像是函数调用中的格式;

#Base images

 

  COPY:  复制文件。 其基本格式:

FROM centos

[root@centos05 ~]# docker container run -itd --name nginx1 -p 99:80 nginx:v1
778176e7bc7ff73bc7aa7cfbd4f09188e7bd754196b588c6b8abfc161ff0762b
[root@centos05 ~]# 
[root@centos05 ~]# docker container exec -it nginx1 bash
[root@778176e7bc7f nignx]# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 02:27 pts/0    00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -g daemon off;
root         5     1  0 02:27 pts/0    00:00:00 nginx: worker process
root         6     0  1 02:27 pts/1    00:00:00 bash
root        18     6  0 02:27 pts/1    00:00:00 ps -ef
[root@778176e7bc7f nignx]# curl 127.0.0.1
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
[root@778176e7bc7f nignx]# exit
exit
[root@centos05 ~]# docker ps 
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                NAMES
778176e7bc7f        nginx:v1            "/usr/local/nginx/..."   32 seconds ago      Up 31 seconds       0.0.0.0:99->80/tcp   nginx1

      格式一:COPY <源路径>…<指标路径>

#MAINTAINER 维护人

 4、浏览器访问测试

      格式2:COPY [“<源路径一>”,…..”<目标路径>”]

MAINTAINER kehaojian

美高梅手机版4858 6

  ADD:
越来越高级的复制文件,在COPY的基本功上加码了有个别效果,假设复制的是压缩包的话,会向来解压,而不要求在使用RUN解压;

#ADD 添加当守田件到镜像

5、配置文件如下

  CMD:容器运行命令。其主导格式:

ADD pcre-8.37.tar.gz /usr/local/src

 1 [root@centos05 nginx]# cat Dockerfile 
 2 FROM centos:7
 3 MAINTAINER  1335120568@qq.com
 4 RUN yum  install -y gcc gcc-c++ make openssl-devel  pcre-devel
 5 ADD nginx-1.12.1.tar.gz /tmp
 6 
 7 RUN cd /tmp/nginx-1.12.1 && \
 8     ./configure --prefix=/usr/local/nginx && \
 9     make && make install
10 
11 
12 RUN  rm -rf /tmp/nginx-1.12.1* && yum clean all
13 
14 COPY  nginx.conf  /usr/local/nginx/conf/
15 
16 WORKDIR  /usr/local/nignx
17 
18 EXPOSE  80
19 
20 CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]
21 
22 [root@centos05 nginx]# 
23 [root@centos05 nginx]# cat nginx.conf 
24 user  root; 
25 worker_processes  auto; 
26 
27 error_log  logs/error.log  info;
28 
29 pid        logs/nginx.pid; 
30 
31 
32 events {
33     use epoll; 
34 }
35 
36 http {
37 
38     include       mime.types;
39     default_type  application/octet-stream;
40 
41     log_format  main '$remote_addr - $remote_user [$time_local] "$request" '
42                       '$status $body_bytes_sent "$http_referer" '
43                       '"$http_user_agent" "$http_x_forwarded_for"';
44 
45     access_log logs/access.log main;
46     sendfile        on;
47     keepalive_timeout  65;
48 
49     server {
50         listen 80;
51         server_name localhost;
52         root html;
53         index index.html index.php;
54 
55         location ~ \.php$ {
56             root html;
57             fastcgi_pass 127.0.0.1:9000;
58             #fastcgi_pass lnmp_php:9000;
59             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
60             include fastcgi_params;
61         }
62     }
63 }

      shell格式: CMD <命令>

ADD nginx-1.9.3.tar.gz /usr/local/src

 

      exec格式: CMD [“可执行文件”, “参数壹”, “参数二”…]

#RUN 在镜像中执行命令

      参数列表格式: CMD [“参数1”,
“参数2”…],在钦定了ENTEnclaveYPOINT指令后,用CMD钦点具体的参数

RUN yum install -y wget gcc_c++ make openssl-devel

  ENT帕杰罗YPOINT: 入口点。其基本格式分为exec和shell,

RUN useradd -s /sbin/nologin -M www

      ENTLX570YPOINT的指标和CMD一样,都是在内定容器运营程序及参数。ENT兰德库罗德YPOINT在运营中得以代表,不过比CMD繁琐,必要通过docker
run 的参数–entrypoint
来钦点。当钦命了ENTKoleosYPOINT后,CMD的含义就产生了改变,不在是平昔运维其命令,而是将CMD的始末作为参数字传送递给ENTLANDYPOINT指令。其履行时就改为了: 
<ENTLX570YPOINT> “<CMD>”

#WOHighlanderKDI猎豹CS陆 镜像中切换来目录

  ENV: 设置环境变量。(都能够运用那里运用的变量)其主旨格式:

WORKDIR /usr/local/src/nginx-1.9.3

      格式1:ENV <key> <value>

RUN yum install -y gcc gcc-c++

      格式2:ENV <key1>=<value1>
<key2>=<value>…

RUN ./configure –prefix=/usr/local/nginx –user=www –group=www
–with-http_ssl_module –with-http_stub_status_module
–with-pcre=/usr/local/src/pcre-8.37 && make && make install

  A帕杰罗G:
营造参数。营造参数和ENV的效率同样,皆以安装环境变量,所例外的是AGL450G所营造的环境变量在明日容器运维时是不存在的。其主导格式:

RUN echo “daemon off;”>>/usr/local/nginx/conf/nginx.conf

      格式1: ARG <参数名> [=<默认值>]

#安排环境变量

      格式②: 该暗中认可值能够在创设命令 docker build  中用
–build-arg <参数名>=<值> 来覆盖

ENV PATH /usr/local/nginx/sbin:$PATH

  VOLUME: 定义匿名卷。 其主导格式:

EXPOSE 80

      格式1: VOLUME [“<路径1>”, “<路径2>”…]

#命令

      格式2: VOLUME <路径>

CMD  [“nginx”]

  EXPOSE: 
揭露端口。EXPOSE指令是宣称运维时容器所提供的端口,在开发银行容器时不会在因为这几个宣称而开启端口。
其大旨格式:

五.实施社团命令  docker build -t nginx-docker:v一 .

      格式1: EXPOSE <端口1> [<端口2>…]

[root@HA2 src]# docker build -t nginx-docker:v1 .

  WO帕杰罗KDICR-V: 钦赐工作目录。其基本格式:

Sending build context to Docker daemon 8.234 MB

      格式一: WO途锐KDICRUISER <工作目录路径>

Step 1 : FROM centos

  USE福特Explorer: 内定当前用户。USE奥迪Q7是赞助您切换来钦命用户。 其主干格式:

—> 3fa822599e10

      格式1: USER <用户名>

Step 2 : MAINTAINER kehaojian

  HEALTCHECK: 健检,判断容器的气象是或不是正规。 其主导格式:

—> Using cache

      格式1: HEALTCHECK [选项] CMD <命令>
:设置检查容器健康意况的指令

—> 7a13a2573c2c

      格式二: HEALTCHECK NONE:
假若基础镜像有健检指令,使用此格式能够屏蔽掉其健检指令

Step 3 : ADD pcre-8.37.tar.gz /usr/local/src


—> Using cache

 构建Nginx镜像:

—> 27f018c7c6c2

开创3个索引,在该目录里编写dockerfile:

Step 4 : ADD nginx-1.9.3.tar.gz /usr/local/src

1

—> Using cache

2

—> 0ac134999174

3

Step 5 : RUN yum install -y wget gcc_c++ make openssl-devel

4

—> Using cache

5

—> 2caeaffce308

[root@docker ~]# mkdir mynginx

Step 6 : RUN useradd -s /sbin/nologin -M www

[root@docker ~]# cd mynginx/

—> Using cache

[root@docker mynginx]# pwd

—> 50fad5999287

/root/mynginx

Step 7 : WORKDIR /usr/local/src/nginx-1.9.3

[root@docker mynginx]#

—> Using cache

下载nginx源码包到创造的目录下(mynginx目录下):

—> c223ad0c0e56

1

Step 8 : RUN yum install -y gcc gcc-c++

[root@docker ~]# wget -P /root/mynginx/ 

—> Using cache

编写Dockerfile:

—> 535006fabee5

[root@docker mynginx]# vi Dockerfile

Step 9 : RUN ./configure –prefix=/usr/local/nginx –user=www
–group=www –with-http_ssl_module –with-http_stub_status_module
–with-pcre=/usr/local/src/pcre-8.37 && make && make install

其剧情如下:

—> Using cache

  • View Code

—> 2c8bfa5d7162

运作docker命令创设镜像:

Step 10 : RUN echo “daemon off;”>>/usr/local/nginx/conf/nginx.conf

[root@docker mynginx]# docker build -t nginx:v3 .
Sending build context to Docker daemon  1.029MB
Step 1/7 : FROM
CentOS
 —> 5182e96772bf
Step 2/7 : RUN ping -c 1 www.baidu.com
 —> Using cache
 —> 2f70f8abaf2a
Step 3/7 : RUN yum -y install gcc make pcre-devel zlib-devel tar zlib
 —> Using cache
 —> dbdda4b7ae6f
Step 4/7 : ADD nginx-1.15.2.tar.gz /usr/src/
 —> Using cache
 —> 18ace6285668
Step 5/7 : RUN cd /usr/src/nginx-1.15.2    && mkdir /usr/local/nginx   
&& ./configure –prefix=/usr/local/nginx && make && make install    &&
ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/    && nginx
 —> Using cache
 —> 99629488ede9
Step 6/7 : RUN rm -rf /usr/src/nginx-1.15.2
 —> Using cache
 —> 869fbad71879
Step 7/7 : EXPOSE 80
 —> Using cache
 —> 384bed72ea6f
Successfully built 384bed72ea6f
Successfully tagged nginx:v3

—> Using cache

输出七个Successfully即为创设成功!

—> 3ab469fa6de1

启航自定义镜像:

Step 11 : ENV PATH /usr/local/nginx/sbin:$PATH

应用 docker images 查看构建的镜像:

—> Using cache

美高梅手机版4858 7

—> 399e3d091604

运行自定义的镜像:

Step 12 : EXPOSE 80

[root@docker ~]# docker run -d -p 80:80 –name nginx nginx:v3
4ac935e955b1c3ac49eed68f3372f3e96a8934fd8ccf4614afa3d7c29eb96c08
[root@docker ~]# docker ps -a
CONTAINER ID        IMAGE              COMMAND            CREATED       
    STATUS                    PORTS              NAMES
4ac935e955b1        nginx:v3            “/bin/bash”        3 seconds
ago      Exited (0) 2 seconds ago                      nginx

—> Using cache

注:那时,你随便怎么运行这一个容器,它依旧直接处于exited状态。

—> 0e84b1ddfd98

通过各样解决,最后,终于知道难点出在了哪。
原来容器运营时,它是在后台对应着1个线程运转的,它在运维时是已经起步了,但它实施完命令后,就淡出了,并不曾在后台运营着,所以选取-dit 参数让它在后台运维即可。

Step 13 : CMD nginx

[root@docker ~]# docker run -dit -p 80:80 –name nginx nginx:v3
ecaafe1190447878b98dfb0198e92439db60ff7dab57a1674e0e9e7282a9c858
[root@docker ~]# docker ps -a
CONTAINER ID        IMAGE              COMMAND            CREATED       
    STATUS              PORTS                NAMES
ecaafe119044        nginx:v3            “/bin/bash”        3 seconds
ago      Up 2 seconds        0.0.0.0:80->80/tcp  nginx

—> Using cache

然而…….

—> 20c4d11561d3

那时候又出新了难题,它纵然起来了,但nginx的web网页界面访问不了,彰显拒绝连接!!!!

Successfully built 20c4d11561d3

[root@docker ~]# curl 192.168.100.22
curl: (柒) Failed connect to 1九二.16捌.100.2二:80; 拒绝连接
[root@docker ~]# elinks –dump 192.168.100.22
ELinks: 拒绝连接

陆.查看镜像 docker images

然后,又通过问百度,FQ看谷歌(谷歌(Google)),终于找到了难点的随地。原来只要利用 exec
进入到容器里运营nginx就能够了。

美高梅手机版4858 8

[root@docker ~]# docker exec -it nginx bash
[root@ecaafe119044 /]# nginx
[root@ecaafe119044 /]# exit
exit

美高梅手机版4858 9

[root@docker ~]# curl 192.168.100.22
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully
installed and
working. Further configuration is required.</p>

七.开发银行容器 docker run -it -d -p 888八:80 –name nginx8888 20c4d115陆1d3

<p>For online documentation and support please refer to
<a href=”;
Commercial support is available at
<a href=”;

美高梅手机版4858 10美高梅手机版4858 11

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

八.查看容器 docker ps -l

如此那般! Nginx镜像就塑造成功了!

美高梅手机版4858 12美高梅手机版4858 13

Linux公社的RSS地址:

9.访问http://ha2:8888

正文永久更新链接地址

美高梅手机版4858 14美高梅手机版4858 15

美高梅手机版4858 16

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图
Copyright @ 2010-2019 美高梅手机版4858 版权所有