At this point I don't have a clear understanding of Docker and its concepts so probably I am not getting something that is obvious: how do I enable sccache
in the Docker image? I picked this block of steps from the "getting-started" guide (swift/docs/HowToGuides/GettingStarted.md at main · swiftlang/swift · GitHub) and made the appropriate changes for them to fit in the Docker file:
# sccache
ENV SCCACHE_CACHE_SIZE="100G"
ARG SCCACHE_VERSION=v0.3.0
RUN curl -L "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/sccache-${SCCACHE_VERSION}-$(uname -m)-unknown-linux-musl.tar.gz" -o sccache.tar.gz \
&& tar xzpvf sccache.tar.gz \
&& cp "sccache-${SCCACHE_VERSION}-$(uname -m)-unknown-linux-musl/sccache" /usr/local/bin \
&& chmod +x /usr/local/bin/sccache
I am on Ubuntu 24.04 LTS. The Swift build using the Docker container ran to completion with no errors. but I am not sure if sccache
was correctly installed for the Docker image. Is my understanding correct when I add the above lines to Dockerfile?
I cloned the swift-docker
repository from GitHub, and ran all the docker commands with swift-docker
as the working directory on my local machine (not to be confused with Docker's working directory). The above changes for sccache
were in this Dockerfile
swift-docker/swift-ci/main/ubuntu/24.04/Dockerfile