https://docs.brew.sh/Homebrew-on-Linux
<< 'eof' docker image build --tag homebrew -f- .
FROM ubuntu:22.04
SHELL ["/bin/bash", "-c"]
RUN export DEBIAN_FRONTEND=noninteractive ; \
apt-get update && \
apt-get install -y \
build-essential \
curl \
file \
git \
procps \
;
RUN yes | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
RUN ( echo ; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /root/.profile;
WORKDIR /root/
eof
docker container run -d -i --name brew homebrew sleep inf
docker container exec -i brew /bin/bash -c 'source ~/.profile ; brew install hello'
docker container exec -i brew /bin/bash -c 'source ~/.profile ; hello'
NOTE: I'm not liking having to source the ~/.profile each time. That should be automatic. Will tackle another time.