File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## Add a build argument to the nginx image
2
+ * Define a build argument to define which package to install
3
+ * ` nginx-light `
4
+ * ` nginx-full `
5
+ * ` nginx-extras `
6
+ * Value should either be ` light ` , ` full ` or ` extras `
7
+ * Set the default to ` full `
8
+ * Make the installed package available in the environment variable ` NGINX_PKG `
9
+ * For example ` nginx-full `
10
+ * Try building and testing the image
11
+ * Add a Docker Compose file
12
+ * Add a service for each variant
13
+ * Set the build arguments
14
+ * Tag the image with the package type installed
15
+ * jfahrer/nginx: stretch-light
16
+ * jfahrer/nginx: stretch-full
17
+ * jfahrer/nginx: stretch-extras
18
+ * Build and push all the images
19
+
20
+ ## The Dockerfile
21
+ ```
22
+ FROM debian:buster-slim
23
+
24
+ RUN apt-get update \
25
+ && apt-get install -y nginx \
26
+ && rm -rf /var/lib/apt/lists/* \
27
+ && rm /var/log/nginx/access.log \
28
+ && rm /var/log/nginx/error.log \
29
+ && ln -s /dev/stdout /var/log/nginx/access.log \
30
+ && ln -s /dev/stderr /var/log/nginx/error.log
31
+
32
+ CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
33
+ ```
You can’t perform that action at this time.
0 commit comments