Skip to content

Commit b5e8e4a

Browse files
authored
Merge pull request #16755 from MinaProtocol/dkijania/prune_dockers_before_build
[CI] Prune dockers before build
2 parents c2c32b7 + 073dd2a commit b5e8e4a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/docker/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ export_docker_tag
163163

164164
BUILD_NETWORK="--network=host"
165165

166+
# Prune old docker images (24 hours) from the cache
167+
# This is a temporary solution to keep the cache from growing too large.
168+
# We will also need to evaluate the impact of this on the build process and adjust as necessary.
169+
docker system prune --all --force --filter until=24h
170+
166171
# If DOCKER_CONTEXT is not specified, assume none and just pipe the dockerfile into docker build
167172
if [[ -z "${DOCKER_CONTEXT}" ]]; then
168173
cat $DOCKERFILE_PATH | docker build $NO_CACHE $BUILD_NETWORK $CACHE $NETWORK $IMAGE $DEB_CODENAME $DEB_RELEASE $DEB_VERSION $DOCKER_DEB_SUFFIX $DEB_REPO $BRANCH $REPO -t "$TAG" -

0 commit comments

Comments
 (0)