Minimize use of RUN instructions

Each RUN instruction adds a layer and size to the docker image. This saved about 14MB in my testing against this image.
This commit is contained in:
puneetse
2019-04-30 16:23:38 -07:00
committed by George T Kramer
parent e5434d77d0
commit c26b654afc
+8 -10
View File
@@ -4,16 +4,14 @@ MAINTAINER bin.yang@intel.com
COPY default.conf /etc/nginx/conf.d/default.conf
RUN swupd update $swupd_args && \
swupd bundle-add nginx $swupd_args
RUN rm -rf /var/lib/swupd
# forward request and error logs to docker log collector
RUN mkdir -p /var/log/nginx
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
RUN mkdir -p /var/lib/nginx/
RUN cp -f /usr/share/nginx/conf/nginx.conf.example /etc/nginx/nginx.conf
swupd bundle-add nginx $swupd_args && \
rm -rf /var/lib/swupd && \
mkdir -p /var/log/nginx && \
# forward request and error logs to docker log collector
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log && \
mkdir -p /var/lib/nginx/ && \
cp -f /usr/share/nginx/conf/nginx.conf.example /etc/nginx/nginx.conf
VOLUME /usr/share/nginx/html