Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile: put some XDG dirs under /tmp #16304

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Warehouse runs as `nobody` with `/nonexistent` as `$HOME`, which causes
# significant shpilkes for libraries that expect to use XDG dirs.
# Placate everybody by making some directories for runtime use.
# Note that this happens right after `/tmp/*` is blown away, because we want
# to keep these.
RUN mkdir -p /tmp/share /tmp/cache
ENV XDG_DATA_HOME /tmp/share
ENV XDG_CACHE_COME /tmp/cache

# Copy the directory into the container, this is done last so that changes to
# Warehouse itself require the least amount of layers being invalidated from
# the cache. This is most important in development, but it also useful for
Expand Down