TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Cloud Run quietly swaps HOME env var in Docker

73 pointsby chanindover 3 years ago

6 comments

sterenover 3 years ago
Cloud Run PM here. Sorry for the inconvenience. This is an issue for which we have a fix, but the fix still needs to roll out (internal bug 154368323 for googlers reading, we&#x27;re still evaluating the best rollout strategy). Until then, I&#x27;ll add it to <a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;run&#x2F;docs&#x2F;issues" rel="nofollow">https:&#x2F;&#x2F;cloud.google.com&#x2F;run&#x2F;docs&#x2F;issues</a>.
评论 #28678790 未加载
评论 #28679665 未加载
评论 #28678173 未加载
justin_oaksover 3 years ago
For those not familiar with Cloud Run, it&#x27;s a Google Cloud service that allows you to run Docker containers without managing the server it runs on.<p><a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;run" rel="nofollow">https:&#x2F;&#x2F;cloud.google.com&#x2F;run</a>
yzmtf2008over 3 years ago
The solution here is to use `$XDG_CACHE_HOME` instead of `$HOME&#x2F;.cache`, which may not be where a user wants their cache to live: <a href="https:&#x2F;&#x2F;specifications.freedesktop.org&#x2F;basedir-spec&#x2F;basedir-spec-latest.html" rel="nofollow">https:&#x2F;&#x2F;specifications.freedesktop.org&#x2F;basedir-spec&#x2F;basedir-...</a>
评论 #28676901 未加载
评论 #28679275 未加载
评论 #28676739 未加载
reilly3000over 3 years ago
As an alternative, don’t use root for Dockerfiles. Ever. It only takes a few lines to create a user, group, and use said user, and closes a whole class of security issues.
评论 #28677039 未加载
评论 #28681281 未加载
评论 #28679979 未加载
评论 #28677229 未加载
评论 #28681204 未加载
wodenokotoover 3 years ago
That sucks.<p>My only advice is, when using this or cloud functions always start by creating a function&#x2F;image that prints all env variables.<p>For cloud functions these changes tremendously between Python version. Also logging changes completely between some Python versions, to the point where upping the runtime causes logs to stop being saved on cloud logging.
评论 #28680471 未加载
cmeacham98over 3 years ago
Does Huggingface not have a way to override the cache directory? I always specify directories like this manually when using docker specifically to avoid issues like the one in TFA.
评论 #28679679 未加载