# How do I enable sccache in the docker image?

**URL:** <https://forums.swift.org/t/how-do-i-enable-sccache-in-the-docker-image/79493>\
**Category:** Compiler\
**Tags:** docker, buildin-the-compiler\
**Created:** [April 24, 2025, 3:58pm UTC](https://forums.swift.org/t/how-do-i-enable-sccache-in-the-docker-image/79493 "2025-04-24T15:58:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgba](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/rgba/32/40617_2.png) [@rgba](https://forums.swift.org/u/rgba)\
**Post date:** [April 24, 2025, 3:58pm UTC](https://forums.swift.org/t/how-do-i-enable-sccache-in-the-docker-image/79493/1 "2025-04-24T15:58:15Z")

</div>

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](https://github.com/swiftlang/swift/blob/main/docs/HowToGuides/GettingStarted.md)) and made the appropriate changes for them to fit in the Docker file:

```swift
# 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`
