File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 12
12
"no_proxy" : " ${localEnv:no_proxy}" ,
13
13
"--tag" : " benchbase-dev:latest"
14
14
},
15
- "cacheFrom" : " benchbase.azurecr.io/benchbase-dev"
15
+ "cacheFrom" : " benchbase.azurecr.io/benchbase-dev:latest "
16
16
},
17
17
"initializeCommand" : [
18
18
" .devcontainer/scripts/initializeCommand"
Original file line number Diff line number Diff line change @@ -415,6 +415,15 @@ jobs:
415
415
key : setup-java-${{ runner.os }}-docker-maven-${{ hashFiles('**/pom.xml') }}
416
416
restore-keys : |
417
417
setup-java-${{ runner.os }}-docker-maven-
418
+ - name : Pull base image caches for PR builds
419
+ if : ${{ github.ref != 'refs/heads/main' }}
420
+ run : |
421
+ docker pull benchbase.azurecr.io/benchbase-dev:latest || true
422
+ docker pull benchbase.azurecr.io/benchbase:latest || true
423
+ - name : Set NO_CACHE env var for main branch builds
424
+ if : ${{ github.ref == 'refs/heads/main' }}
425
+ run : |
426
+ echo "NO_CACHE=true" >> $GITHUB_ENV
418
427
- name : Build benchbase-dev image
419
428
run : |
420
429
./docker/benchbase/build-dev-image.sh
Original file line number Diff line number Diff line change @@ -83,3 +83,10 @@ if [ "$DOCKER_BUILDKIT" == 1 ]; then
83
83
docker_build_args=' --progress=plain'
84
84
fi
85
85
export DOCKER_BUILDKIT
86
+
87
+ if [ " ${NO_CACHE:- false} " == ' true' ]; then
88
+ docker_build_args+=' --pull --no-cache'
89
+ else
90
+ upstream_image=" benchbase.azurecr.io/$imagename :latest"
91
+ docker_build_args+=" --cache-from=$upstream_image "
92
+ fi
You can’t perform that action at this time.
0 commit comments