I use a multi stages docker build for my aws codeBuild to build my application. The shape of my docker file is :
FROM strapi/base:14-alpine AS dependencies
...
FROM strapi/base:14-alpine As liveProduction
ENV NODE_ENV="production"
COPY --from=dependencies /toto /toto
....
FROM strapi/base:14-alpine As liveDevelopment
ENV NODE_ENV="development"
COPY --from=dependencies /toto /toto
...
And to build my application for production, i use aws buildspect.yml and in this file i have the following comande :
docker build --no-cache --target liveProduction -t app-facej-backoffice .
This command doesn't work very well, because, all stages are executed with the following order : dependencies, liveProduction, liveDevelopment. In this case, i want only dependencies and liveDevelopment to be executed.
I would like to know what is the problem ? Why the --target option of docker build doesn't work in codeBuild?
Thanks.