![]() This allows us to copy our built CSS into our final image. We now reference the transient container created by this stage using COPY -from=sass. The AS clause created a named stage called sass. Back at the top, we wrote our first FROM statement as FROM node:14 AS sass. Later on, our Dockerfile uses COPY -from again, this time in a different form. Ordinarily, COPY copies files from your local build context into your image with -from and an image name, it’ll create a new container using that image and then copy the specified file out of it. As we’re not running any commands against the Composer image, we can use the -from flag with COPY to reference the image. We didn’t need a FROM statement to do this. We therefore copy the binary into our container from the dedicated Composer image. Composer is PHP’s package manager but it’s not included with the official PHP Docker images. We next use Composer to install our PHP dependencies.
0 Comments
Leave a Reply. |