Skip to content

Instantly share code, notes, and snippets.

@buzzedword
Last active June 5, 2018 06:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buzzedword/dcd59a7a8a39ab3d7cd2e21681cfd229 to your computer and use it in GitHub Desktop.
Save buzzedword/dcd59a7a8a39ab3d7cd2e21681cfd229 to your computer and use it in GitHub Desktop.
Multistage builds in Docker 17.05
FROM php as vendoring-image
RUN apt-get update && \
apt-get install -y --no-install-recommends git zip
RUN curl --silent --show-error https://getcomposer.org/installer | php && \
mv composer.phar /bin/composer
COPY ./composer.json ./composer.lock /app
WORKDIR /app
RUN composer install
# PS - This is the only image we want to push. Crazy, right?
FROM php:alpine as production-image
RUN mkdir /app
COPY --from=vendoring-image /app/vendors /app/vendors
@sonu27
Copy link

sonu27 commented May 24, 2018

Should be vendor not vendors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment