Dockerfile: set cache location#5865
Dockerfile: set cache location#5865jonchang wants to merge 1 commit intoHomebrew:masterfrom jonchang:docker-cache
Conversation
sjackman
left a comment
There was a problem hiding this comment.
The default user in the Docker container is root, and root should have write permission to its home directory /root/.cache. Have you changed users to for example linuxbrew?
There's something going on where |
$ docker pull linuxbrew/brew
$ docker run --rm linuxbrew/brew id
uid=0(root) gid=0(root) groups=0(root)What do you see? |
|
The default user in |
|
I think $ docker run --rm linuxbrew/brew id
uid=0(root) gid=0(root) groups=0(root)test-bot: $ docker run --rm linuxbrew/brew brew test-bot
Updating Homebrew...
warning: unable to access '/root/.config/git/attributes': Permission denied
[snip]
==> Tapping homebrew/test-bot
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot'...
warning: unable to access '/root/.config/git/attributes': Permission denied
Tapped 1 command and 1 formula (49 files, 262KB).
Error: Permission denied @ dir_s_mkdir - /root/.cache
Error: Failure while executing; `/usr/bin/sudo -u \#1000 /home/linuxbrew/.linuxbrew/bin/brew tap homebrew/test-bot` exited with 1.Not test-bot: $ docker run --rm linuxbrew/brew brew tap homebrew/test-bot
Updating Homebrew...
[snip]
==> Tapping homebrew/test-bot
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot'...
Tapped 1 command and 1 formula (49 files, 262KB). |
This error is quite weird to me. Is |
|
I am hit by this issue to on ubuntu. This was working fine previously: |
|
Maybe there is an issue with this line? |
|
Yes! That's definitely the culprit. I hadn't found that line. Good sleuthing! |
|
Should we just remove it? |
|
@sjackman Sounds good to me. |
|
Superseded by PR #5917 |
When running
docker pull linuxbrew/brew && docker run linuxbrew/brew brew test-botit fails with:This sets
XDG_CACHE_HOMEto/home/linuxbrew/.cacheto prevent this issue.