Skip to content
This repository was archived by the owner on May 23, 2021. It is now read-only.

Commit 6bcbebd

Browse files
committed
Change Docker cache mount
This is to allow building locally with Docker without stepping on the cache of your local machine or other Docker images.
1 parent 286b7d5 commit 6bcbebd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/ci.bash

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ function docker-build() {
77
local image="$1" ; shift
88
local prebuild_command="$1" ; shift
99

10+
local cache="$HOME/.cache"
11+
if [[ -n ${XDG_CACHE_HOME:-} ]] ; then
12+
cache="$XDG_CACHE_HOME"
13+
elif [[ $OSTYPE == "darwin"* ]]; then
14+
cache="$HOME/Library/Caches"
15+
fi
16+
1017
local containerId
11-
containerId=$(docker create --network=host --rm -it -v "$(pwd)":/src -v "$HOME/.cache/ccache:/root/.cache/ccache" "$image")
18+
containerId=$(docker create --network=host --rm -it -v "$(pwd)":/src -v "$cache/ccache/$image:/root/.cache/ccache" "$image")
1219
docker start "$containerId"
1320

1421
function docker-exec() {

0 commit comments

Comments
 (0)