1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Hi,
Local CodeBuild cache is best effort and can be erased between builds.
What people usually do to circumvent local cache issue is to build a cache layer in ECR
See https://github.com/aws/aws-codebuild-docker-images/issues/26#issuecomment-370177343
version: 0.2
phases:
pre_build:
commands:
- docker version
- $(aws ecr get-login --no-include-email)
- docker pull $CONTAINER_REPOSITORY_URL:$REF_NAME || true
build:
commands:
- docker build --cache-from $CONTAINER_REPOSITORY_URL:$REF_NAME --tag $CONTAINER_REPOSITORY_URL:$REF_NAME --tag $CONTAINER_REPOSITORY_URL:ref-$CODEBUILD_RESOLVED_SOURCE_VERSION .
post_build:
commands:
- docker push $CONTAINER_REPOSITORY_URL
Re. docker build --cache-from
, see https://docs.docker.com/build/cache/
Best,
Didier
Contenus pertinents
- demandé il y a un an
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
Thanks a lot! This works for me.