Skip to content

Can S3 Cache Docker Layers in AWS CodeBuild?

0

Hello, community,

I have a question related to the AWS CodeBuild caching option.

If I understand correctly, by default, Docker layers are not cached, meaning all subsequent runs execute the same steps even if no changes are made, which is not desirable for me. I see two caching options available:

  • Local
  • S3

The local caching option works fine and caches Docker layers, but I tested it with a delay of 5 minutes, and it might not always work because AWS does not guarantee that it will use the same machine, correct?

So, regarding the S3 option, is it possible to cache Docker layers with S3, rather than just folders? Thank you in advance!

asked 2 years ago628 views

1 Answer
0

Hello,

following this article in AWS network: https://aws.amazon.com/blogs/devops/improve-build-performance-and-save-time-using-local-caching-in-aws-codebuild/

You can use a Docker Layer Cache Mode, which allows you to download big images from Internet, fighting off any delay you may get. For the second point I am not sure, but maybe yo ucan find the right switch in the docs for the S3 Cache on Docker, here:

https://docs.docker.com/build/cache/backends/s3/

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.