Upgrade to Pro — share decks privately, control downloads, hide ads and more …

噂のマルチステージングビルドを試してみました

chiroruxx
August 28, 2019

 噂のマルチステージングビルドを試してみました

2019/08/28 PHP勉強会で発表した資料です。

chiroruxx

August 28, 2019
Tweet

More Decks by chiroruxx

Other Decks in Technology

Transcript

  1. %PDLFSGJMF FROM alpine:latest RUN apk add --no-cache --update \ nginx

    \ zip COPY ./package.zip /var/www RUN cd /var/www && \ unzip package.zip && \ chown -R nginx:nginx package && \ rm package.zip RUN mkdir -p /run/nginx EXPOSE 80 CMD nginx -g "daemon off;"
  2. %PDLFSGJMF FROM alpine:latest RUN apk add --no-cache --update \ nginx

    \ zip COPY ./package.zip /var/www RUN cd /var/www && \ unzip package.zip && \ chown -R nginx:nginx package && \ rm package.zip RUN mkdir -p /run/nginx EXPOSE 80 CMD nginx -g "daemon off;"
  3. %PDLFSGJMF શମ FROM alpine:latest as package RUN apk add --no-cache

    --update \ zip COPY ./package.zip /opt RUN cd /opt && \ unzip package.zip FROM alpine:latest RUN apk add --no-cache --update \ nginx COPY --from=package --chown=nginx:nginx /opt/package /var/www/package RUN mkdir -p /run/nginx EXPOSE 80 CMD nginx -g "daemon off;"
  4. %PDLFSGJMF શମ FROM alpine:latest as package RUN apk add --no-cache

    --update \ zip COPY ./package.zip /opt RUN cd /opt && \ unzip package.zip FROM alpine:latest RUN apk add --no-cache --update \ nginx COPY --from=package --chown=nginx:nginx /opt/package /var/www/package RUN mkdir -p /run/nginx EXPOSE 80 CMD nginx -g "daemon off;" Ұ࣌తͳΠϝʔδ ຊମ
  5. %PDLFSGJMF QBDLBHF FROM alpine:latest as package RUN apk add --no-cache

    --update \ zip COPY ./package.zip /opt RUN cd /opt && \ unzip package.zip
  6. %PDLFSGJMF CPEZ FROM alpine:latest RUN apk add --no-cache --update \

    nginx COPY --from=package --chown=nginx:nginx \ /opt/package /var/www/package RUN mkdir -p /run/nginx EXPOSE 80 CMD nginx -g "daemon off;"