Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 96a3c6f

Browse files
mraerinocalavera
authored andcommitted
Support installing tools via homebrew
1 parent ff8f5a3 commit 96a3c6f

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

Dockerfile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
4848
emacs25-nox \
4949
esl-erlang \
5050
expect \
51+
file \
5152
fontconfig \
5253
fontconfig-config \
5354
g++ \
@@ -465,7 +466,6 @@ ENV DOTNET_ROOT "/opt/buildhome/.dotnet"
465466
#populate local package cache
466467
RUN dotnet new
467468

468-
469469
################################################################################
470470
#
471471
# Swift
@@ -479,6 +479,20 @@ ENV PATH "$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH"
479479
RUN swiftenv install ${NETLIFY_BUILD_SWIFT_VERSION}
480480
RUN swift --version
481481

482+
################################################################################
483+
#
484+
# Homebrew
485+
#
486+
################################################################################
487+
USER buildbot
488+
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
489+
ENV PATH "/opt/buildhome/.linuxbrew/bin:$PATH"
490+
ENV HOMEBREW_PREFIX "/opt/buildhome/.linuxbrew"
491+
ENV HOMEBREW_CELLAR "/opt/buildhome/.linuxbrew/Cellar"
492+
ENV HOMEBREW_REPOSITORY "/opt/buildhome/.linuxbrew/Homebrew"
493+
ENV HOMEBREW_CACHE "/opt/buildhome/.homebrew-cache"
494+
RUN brew tap homebrew/bundle
495+
482496
WORKDIR /
483497

484498
# Cleanup

included_software.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ The specific patch versions included will depend on when the image was last buil
7272
* [Doxygen](http://www.doxygen.org) - 1.8.6
7373
* [WASMER](https://github.com/wasmerio/wasmer)
7474
* [WAPM](https://github.com/wasmerio/wapm-cli)
75+
76+
* [Homebrew](https://brew.sh/)
77+
- Any linux formula is supported: https://formulae.brew.sh/formula-linux/
78+
- Formulae from a `Brewfile` are installed automatically via [`brew bundle`](https://github.com/Homebrew/homebrew-bundle#readme)
79+
- `HOMEBREW_BUNDLE_FILE` is respected

run-build-functions.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ mkdir -p $NETLIFY_CACHE_DIR/.composer
5555
mkdir -p $NETLIFY_CACHE_DIR/.gimme_cache/gopath
5656
mkdir -p $NETLIFY_CACHE_DIR/.gimme_cache/gocache
5757
mkdir -p $NETLIFY_CACHE_DIR/.wasmer/cache
58+
mkdir -p $NETLIFY_CACHE_DIR/.homebrew-cache
5859

5960
: ${YARN_FLAGS=""}
6061
: ${NPM_FLAGS=""}
@@ -652,6 +653,12 @@ install_dependencies() {
652653
rm -rf $GOPATH/src/$GO_IMPORT_PATH
653654
ln -s /opt/buildhome/repo ${GOPATH}/src/$GO_IMPORT_PATH
654655
fi
656+
657+
# Homebrew from Brewfile
658+
if [ -f Brewfile ] || [ ! -z "$HOMEBREW_BUNDLE_FILE" ]
659+
then
660+
brew bundle
661+
fi
655662
}
656663

657664
#
@@ -675,6 +682,7 @@ cache_artifacts() {
675682
cache_home_directory ".boot" "boot dependencies"
676683
cache_home_directory ".composer" "composer dependencies"
677684
cache_home_directory ".wasmer/cache", "wasmer cache"
685+
cache_home_directory ".homebrew-cache", "homebrew cache"
678686

679687
# Don't follow the Go import path or we'll store
680688
# the origin repo twice.

0 commit comments

Comments
 (0)