Improve docker build time in CI environment #1748
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
feature-request
A feature should be added or improved.
package/tools
Related to AWS CDK Tools or CLI
Hello,
In a CI environment where no layer cache are available, docker builds of ECS tasks can take a very long time.
A classic solution for this is to pull first the latest image from the registry and use it as an input for the
--cache-from
argument ofdocker build
(see here aws/aws-codebuild-docker-images#26 (comment) and https://medium.com/@gajus/making-docker-in-docker-builds-x2-faster-using-docker-cache-from-option-c01febd8ef84).This implies the following changes in
prepareContainerAsset
:calculateImageFingerprint
, tag withlatest
process.env.CI
) try to pulllatest
first and then build with--cache-from
(
toolkitInfo.prepareEcrRepository
should also be refactored/splitted in order to get therepostoryUri
sooner/without having to pass atag
)I would be interested to have aws-cdk's team opinion on this.
The text was updated successfully, but these errors were encountered: