My Dockerfile:
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2016
COPY AWSCLIV2.msi .
RUN Start-Process msiexec.exe -Wait -ArgumentList '/I AWSCLIV2.msi /quiet /qn /norestart /log awscli.log'
RUN rm AWSCLIV2.msi
My CodeBuild environment needs to be able to build a .NET Framework project as well as use AWS CLI. Due to limitations, I can only have one CodeBuild stage. I push to ECR the docker image created using the above Dockerfile and set my CodeBuild environment to use that image. However it takes ~10 minutes to provision.
CodeBuild provides caching that only lasts ~15 minutes which is not helpful for more infrequent builds. I also found this solution that others linked to https://github.com/aws/aws-codebuild-docker-images/issues/26#issuecomment-370177343 but I'm not sure how it can be applied to Windows containers.
If anyone has any pointers on decreasing the provisioning time, I would really appreciate it.
Windows images are large, so the provisioning time which includes the time to pull down the custom image to CodeBuild instance will be relatively long.
There are two approaches that can help:
Use the base layer for the custom image same as that of CodeBuild image, so that the base layer could be reused and won't incur download time. e.g.:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With