Merge pull request #1130 from ublue-os/brew-compress

chore: compress brew on image
This commit is contained in:
m2 2024-05-16 11:33:52 -04:00 committed by GitHub
commit 7e2f60e212
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 10 deletions

View File

@ -542,9 +542,7 @@ RUN touch /.dockerenv && \
curl -Lo /tmp/brew-install https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh && \
chmod +x /tmp/brew-install && \
/tmp/brew-install && \
rm -rf /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor && \
rm -rf /home/linuxbrew/.linuxbrew/Homebrew/.git && \
cp -R /home/linuxbrew /usr/share/homebrew && \
tar --zstd -cvf /usr/share/homebrew.tar.zst /home/linuxbrew/.linuxbrew && \
ostree container commit
# Cleanup & Finalize

View File

@ -7,13 +7,11 @@ ConditionPathExists=!/var/home/linuxbrew/.linuxbrew
[Service]
Type=oneshot
Environment=HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
Environment=HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
Environment=HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
ExecStart=/usr/bin/cp -R -n /usr/share/homebrew/.linuxbrew /var/home/linuxbrew
ExecStart=/home/linuxbrew/.linuxbrew/bin/brew update
ExecStart=/home/linuxbrew/.linuxbrew/bin/brew upgrade
ExecStart=/usr/bin/mkdir -p /tmp/homebrew
ExecStart=/usr/bin/tar --zstd -xvf /usr/share/homebrew.tar.zst -C /tmp/homebrew
ExecStart=/usr/bin/cp -R -n /tmp/homebrew/home/linuxbrew/.linuxbrew /var/home/linuxbrew
ExecStart=/usr/bin/chown -R 1000:1000 /var/home/linuxbrew
ExecStart=/usr/bin/rm -rf /tmp/homebrew
ExecStart=/usr/bin/touch /etc/.linuxbrew
[Install]

View File

@ -4,7 +4,7 @@ if status --is-interactive
if [ -d /home/linuxbrew/.linuxbrew ]
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
if [ -w /home/linuxbrew/.linuxbrew ]
if [ ! -L (brew --prefix)/share/fish/vendor_completions.d/brew]
if [ ! -L (brew --prefix)/share/fish/vendor_completions.d/brew ]
brew completions link > /dev/null
end
end