If your configuration is as follows:
Due to the long build time of the web workload, the build sometimes currently completes in the order web → app. Need to control the build in the order app → web.
Resolution: Stop copying from one image to another
The dependency comes from this line:
COPY --from=supplychainpkgprod.******/tap/workloads/<workloadname>:latest /src/app/static/dist /var/www/static/dist
If the web workload uses a Dockerfile, then the app workload does too. Both workloads/dockerfiles have access to the same code repo.
So you can just copy the lines from app's Dockerfile that create that /src/app/static/dist, put those commands into the web workload. Then no more dependency of web on app.
e.g. instead of the web Dockerfile having:
COPY --from=supplychainpkgprod.******/tap/workloads/<workloadname>:latest /src/app/static/dist /var/www/static/dist
It would have
FROM base as app-rebuild
RUN some-build-instructions
FROM base as web
COPY --from=app-rebuild /src/app/static/dist /var/www/static/dist