-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple docker builds causing slow build #3510
Comments
Hello @srbartlett. Thank you for your love for Copilot! As for the build time, it is a great question. I think the reason is because previously, for each service we use the same image for all the environments it deploys to. However, after v1.16, we use different images. In order to speed up the image building, you could modify your buildspec so that for each service can use the same image for all the environments it deploys to (see here). However, I think for the second build for the same image. For example, in your case, LBS image for the second environment, though it requires another
Could you help me to verify if it is the same for your pipeline? |
Hi @iamhopaul123 , thanks for your comment. Regarding you first point to modify the buildspec, I am correct to assume if I remove ${env} from tag it will only build the image once? If so, I'll give it a go. Regarding the cache, yes subsequent builds use the cache. In fact, I added However, my dockerfile includes a
|
Yeah feel free to do so if you want to use the same image.
We don't do very fancy docker command translation, so the docker build command would be something like
Do you think that'll help your debugging 🤔 |
thanks @iamhopaul123, yet to experiment with the tag change as suggest but I'll update you once I do. For whatever reason the image |
This may not help you @srbartlett but I had the same issue (except with 20+ services). The main problem I think is that:
Is output to the I've added Also the buildspec.yml references |
Thanks @chrisflatley - that was really helpful 👍 |
I think this was solved by #1999, now it's possible to specify an image already built for another service (with |
I'm going to close this issue as it looks like it's been resolved thanks to the workaround shared by @chrisflatley! Feel free to reopen if there are any questions remaining. |
Hi, I am looking for guidance on the build pipeline step. Firstly, thanks for providing such a great tool chain. Life is better with Copilot 👍
After upgrading from 1.5 to 1.16, I rebuilt the pipeline and have noticed my build step takes significantly longer to complete. I have x2 environments and x2 services (LBS and Backend Service).
The build step runs
docker build
four times. Is it necessary to build an image per environment per services? I would have through a docker build for each service which is tagged for the different environments would suffice. I am missing something?The text was updated successfully, but these errors were encountered: