Skip to content

Commit d333f8b

Browse files
committedNov 19, 2018
fix ccache for Docker images
1 parent 3e9fdb1 commit d333f8b

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed
 

‎.ci/travis/linux/script.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ set -e
1919
mkdir -p "$CCACHE_DIR"
2020

2121
if [[ ${DOCKER_BUILD_QGIS_IMAGE} =~ true ]]; then
22+
# copy ccache dir within QGIS source so it can be accessed from docker
23+
cp -r ${CCACHE_DIR} ${TRAVIS_BUILD_DIR}/.ccache
2224
# building docker images
2325
DIR=$(git rev-parse --show-toplevel)/.docker
2426
pushd "${DIR}"
2527
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}"
26-
docker build --build-arg CACHE_DIR=/root/.ccache \
27-
--build-arg DOCKER_TAG="${DOCKER_TAG}" \
28+
docker build --build-arg DOCKER_TAG="${DOCKER_TAG}" \
2829
--cache-from "qgis/qgis:${DOCKER_TAG}" \
2930
-t "qgis/qgis:${DOCKER_TAG}" \
3031
-f qgis.dockerfile ..

‎.docker/docker-compose.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ services:
1616
image: qgis/qgis3-build-deps:${DOCKER_TAG}
1717
volumes:
1818
- ${TRAVIS_BUILD_DIR}:/root/QGIS
19-
- $HOME/.ccache:/root/.ccache # if changed, also change env var
19+
- ${CCACHE_DIR}:/root/.ccache # if changed, also change env var
2020
links:
2121
- postgres
2222
- mssql

‎.docker/qgis.dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
# see https://docs.docker.com/docker-cloud/builds/advanced/
44
# using ARG in FROM requires min v17.05.0-ce
55
ARG DOCKER_TAG=latest
6-
ARG CACHE_DIR
76

87
FROM qgis/qgis3-build-deps:${DOCKER_TAG}
98
MAINTAINER Denis Rouzaud <denis@opengis.ch>
109

10+
LABEL Description="Docker container with QGIS" Vendor="QGIS.org" Version="1.1"
1111
ENV CC=/usr/lib/ccache/clang
1212
ENV CXX=/usr/lib/ccache/clang++
1313
ENV QT_SELECT=5
1414
ENV LANG=C.UTF-8
1515

1616
COPY . /usr/src/QGIS
1717

18-
COPY ${CACHE_DIR} /root/.ccache
19-
ENV CCACHE_DIR=/root/.ccache
18+
ENV CCACHE_DIR=/usr/src/QGIS/.ccache
2019
RUN ccache -M 1G
2120
RUN ccache -s
2221

‎.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cache:
77
apt: true
88
pip: true
99
directories:
10-
- $HOME/.ccache
10+
- ${HOME}/.ccache
1111
timeout: 1000
1212

1313
env:

0 commit comments

Comments
 (0)
Please sign in to comment.