title: Provisioning a custom Docker image on AWS CodeBuild takes a very long time
body: <p>My Dockerfile:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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. </p>
  
  <p>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 <a href="https://github.com/aws/aws-codebuild-docker-images/issues/26#issuecomment-370177343" rel="nofollow noreferrer">https://github.com/aws/aws-codebuild-docker-images/issues/26#issuecomment-370177343</a> but I'm not sure how it can be applied to Windows containers.</p>
  
  <p>If anyone has any pointers on decreasing the provisioning time, I would really appreciate it.</p>