Skip to content

Commit 39937c9

Browse files
Alexander Merklexiaoxiang781216
Alexander Merkle
authored andcommitted
tools/ci/docker/linux/Dockerfile: fix ccache when running container as 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.
1 parent 6098747 commit 39937c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: tools/ci/docker/linux/Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,10 @@ ENV ZAP_INSTALL_PATH=/tools/zap_release
498498
ENV ZAP_DEVELOPMENT_PATH=/tools/zap
499499

500500
# Configure ccache
501-
RUN mkdir -p /tools/ccache/bin && \
501+
# use `/ccache` as cachedir for all users
502+
RUN mkdir -p /ccache && \
503+
chmod 666 /ccache && \
504+
mkdir -p /tools/ccache/bin && \
502505
ln -sf `which ccache` /tools/ccache/bin/aarch64-none-elf-gcc && \
503506
ln -sf `which ccache` /tools/ccache/bin/aarch64-none-elf-g++ && \
504507
ln -sf `which ccache` /tools/ccache/bin/arm-none-eabi-gcc && \
@@ -527,5 +530,6 @@ RUN mkdir -p /tools/ccache/bin && \
527530
ln -sf `which ccache` /tools/ccache/bin/xtensa-esp32s3-elf-g++
528531

529532
ENV PATH="/tools/ccache/bin:$PATH"
533+
ENV CCACHE_DIR="/ccache"
530534

531535
CMD [ "/bin/bash" ]

0 commit comments

Comments
 (0)