Skip to content

Commit

Permalink
fix ccache for Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Nov 19, 2018
1 parent 3e9fdb1 commit d333f8b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .ci/travis/linux/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ set -e
mkdir -p "$CCACHE_DIR"

if [[ ${DOCKER_BUILD_QGIS_IMAGE} =~ true ]]; then
# copy ccache dir within QGIS source so it can be accessed from docker
cp -r ${CCACHE_DIR} ${TRAVIS_BUILD_DIR}/.ccache
# building docker images
DIR=$(git rev-parse --show-toplevel)/.docker
pushd "${DIR}"
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}"
docker build --build-arg CACHE_DIR=/root/.ccache \
--build-arg DOCKER_TAG="${DOCKER_TAG}" \
docker build --build-arg DOCKER_TAG="${DOCKER_TAG}" \
--cache-from "qgis/qgis:${DOCKER_TAG}" \
-t "qgis/qgis:${DOCKER_TAG}" \
-f qgis.dockerfile ..
Expand Down
2 changes: 1 addition & 1 deletion .docker/docker-compose.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
image: qgis/qgis3-build-deps:${DOCKER_TAG}
volumes:
- ${TRAVIS_BUILD_DIR}:/root/QGIS
- $HOME/.ccache:/root/.ccache # if changed, also change env var
- ${CCACHE_DIR}:/root/.ccache # if changed, also change env var
links:
- postgres
- mssql
Expand Down
5 changes: 2 additions & 3 deletions .docker/qgis.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
# see https://docs.docker.com/docker-cloud/builds/advanced/
# using ARG in FROM requires min v17.05.0-ce
ARG DOCKER_TAG=latest
ARG CACHE_DIR

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

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

COPY . /usr/src/QGIS

COPY ${CACHE_DIR} /root/.ccache
ENV CCACHE_DIR=/root/.ccache
ENV CCACHE_DIR=/usr/src/QGIS/.ccache
RUN ccache -M 1G
RUN ccache -s

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cache:
apt: true
pip: true
directories:
- $HOME/.ccache
- ${HOME}/.ccache
timeout: 1000

env:
Expand Down

0 comments on commit d333f8b

Please sign in to comment.