Skip to content

Commit

Permalink
tools/ci/docker/linux/Dockerfile: fix ccache when running container a…
Browse files Browse the repository at this point in the history
…s user

Normally ccache places the temporary files in `~/.ccache`, when invoking the container with
  `-u <uid>:<gid>`
as e.g. Jenkins does, this might result in a invalid/unknown home folder.
Thus ccache tries to write to `/.ccache` which doesn't exist and the user doesn't have any permissions.

Explicitly set `CCACHE_DIR` to a folder with appropriate permissions.
  • Loading branch information
Alexander Merkle authored and xiaoxiang781216 committed Sep 5, 2024
1 parent 6098747 commit 39937c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/ci/docker/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,10 @@ ENV ZAP_INSTALL_PATH=/tools/zap_release
ENV ZAP_DEVELOPMENT_PATH=/tools/zap

# Configure ccache
RUN mkdir -p /tools/ccache/bin && \
# use `/ccache` as cachedir for all users
RUN mkdir -p /ccache && \
chmod 666 /ccache && \
mkdir -p /tools/ccache/bin && \
ln -sf `which ccache` /tools/ccache/bin/aarch64-none-elf-gcc && \
ln -sf `which ccache` /tools/ccache/bin/aarch64-none-elf-g++ && \
ln -sf `which ccache` /tools/ccache/bin/arm-none-eabi-gcc && \
Expand Down Expand Up @@ -527,5 +530,6 @@ RUN mkdir -p /tools/ccache/bin && \
ln -sf `which ccache` /tools/ccache/bin/xtensa-esp32s3-elf-g++

ENV PATH="/tools/ccache/bin:$PATH"
ENV CCACHE_DIR="/ccache"

CMD [ "/bin/bash" ]

0 comments on commit 39937c9

Please sign in to comment.