在AWS CodeBuild中使用本地缓存时限时? [英] Limited time when using local cache in AWS CodeBuild?

查看:64
本文介绍了在AWS CodeBuild中使用本地缓存时限时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在AWS CodeBuild中使用Docker层缓存.我已经看到了使用它减少构建或提取Docker映像时所需的效果,但是我发现它只能在特定时间段(大约少于1小时)内使用本地缓存.我还没有看到任何有关此的文件.

I am trying to use the Docker layer cache in AWS CodeBuild. I have seen the effect when using it to reduce the time when building or pulling Docker image, but I found that it can only use local cache in a certain time period (about less than 1 hour). I have not seen any document about this.

我在哪里感到困惑或有办法设置缓存存储时间?

Where did I get confused or do I have a way to set up the cache storage time?

在CodeBuild中构建缓存

推荐答案

本地缓存模式是尽力而为的.构建完成后,它们将在有限的时间内可用.用于工件的S3缓存选项更耐用,但它们可能不太适合Docker层.我们没有相关文件,因为您的行程可能会有所不同.

Local cache modes are best effort. They are available for a limited time after the build finishes. The S3 cache option for your artifacts are more durable, but they likely aren't well suited for Docker layers. We don't have documentation on it, as your mileage may vary.

如果运行稀疏构建,则不太可能看到本地缓存Docker层的好处.您可以从构建容器中保存并还原Amazon ECR中的图层:

If you run sparse builds, you are unlikely to see the benefits with local caching of your Docker layers. You may instead save and restore layer in Amazon ECR from your build container: https://github.com/aws/aws-codebuild-docker-images/issues/26#issuecomment-370177343.

在将来的版本中,我们将使您能够选择备份ECR注册表中的层.

In a future release, we will enable you to opt for backing up layers in your ECR registry.

这篇关于在AWS CodeBuild中使用本地缓存时限时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆