2022-04-28 21:21:38 +01:00
|
|
|
ARG version=22.04
|
2022-12-13 10:40:41 +00:00
|
|
|
# version is passed through by Docker.
|
2021-09-14 21:23:39 +08:00
|
|
|
# shellcheck disable=SC2154
|
|
|
|
FROM ubuntu:"${version}"
|
2020-04-27 22:37:35 -07:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2018-10-23 21:37:15 -07:00
|
|
|
|
2022-12-13 10:40:41 +00:00
|
|
|
# We don't want to manually pin versions, happy to use whatever
|
|
|
|
# Ubuntu thinks is best.
|
2020-04-25 14:16:34 +01:00
|
|
|
# hadolint ignore=DL3008
|
2022-12-13 10:40:41 +00:00
|
|
|
|
|
|
|
# /etc/lsb-release is checked inside the container and sets DISTRIB_RELEASE.
|
|
|
|
# shellcheck disable=SC1091,SC2154
|
2018-10-23 21:37:15 -07:00
|
|
|
RUN apt-get update \
|
2022-04-25 07:59:51 +02:00
|
|
|
&& apt-get install -y --no-install-recommends software-properties-common gnupg-agent \
|
2020-05-03 14:29:09 +01:00
|
|
|
&& add-apt-repository -y ppa:git-core/ppa \
|
|
|
|
&& apt-get update \
|
2020-04-26 09:55:14 +01:00
|
|
|
&& apt-get install -y --no-install-recommends \
|
2022-12-13 10:40:41 +00:00
|
|
|
acl \
|
|
|
|
bzip2 \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
file \
|
|
|
|
fonts-dejavu-core \
|
|
|
|
g++ \
|
|
|
|
gawk \
|
|
|
|
git \
|
|
|
|
less \
|
|
|
|
libz-dev \
|
|
|
|
locales \
|
|
|
|
make \
|
|
|
|
netbase \
|
|
|
|
openssh-client \
|
|
|
|
patch \
|
|
|
|
sudo \
|
|
|
|
uuid-runtime \
|
|
|
|
tzdata \
|
|
|
|
jq \
|
|
|
|
&& if [[ "$(. /etc/lsb-release; echo "${DISTRIB_RELEASE}" | cut -d. -f1)" -ge 18 ]]; then apt-get install gpg; fi \
|
2022-11-30 16:02:46 +00:00
|
|
|
&& apt-get remove --purge -y software-properties-common \
|
|
|
|
&& apt-get autoremove --purge -y \
|
2020-04-27 22:37:35 -07:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \
|
2020-04-26 09:55:14 +01:00
|
|
|
&& useradd -m -s /bin/bash linuxbrew \
|
2021-08-03 17:56:21 -06:00
|
|
|
&& echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers \
|
|
|
|
&& su - linuxbrew -c 'mkdir ~/.linuxbrew'
|
2020-04-27 22:37:35 -07:00
|
|
|
|
2021-08-03 17:56:21 -06:00
|
|
|
USER linuxbrew
|
|
|
|
COPY --chown=linuxbrew:linuxbrew . /home/linuxbrew/.linuxbrew/Homebrew
|
2021-09-13 20:32:20 +08:00
|
|
|
ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
|
2020-04-27 22:37:35 -07:00
|
|
|
WORKDIR /home/linuxbrew
|
2020-04-25 14:16:34 +01:00
|
|
|
|
2021-08-18 16:55:05 +02:00
|
|
|
RUN mkdir -p \
|
2022-12-13 10:40:41 +00:00
|
|
|
.linuxbrew/bin \
|
|
|
|
.linuxbrew/etc \
|
|
|
|
.linuxbrew/include \
|
|
|
|
.linuxbrew/lib \
|
|
|
|
.linuxbrew/opt \
|
|
|
|
.linuxbrew/sbin \
|
|
|
|
.linuxbrew/share \
|
|
|
|
.linuxbrew/var/homebrew/linked \
|
|
|
|
.linuxbrew/Cellar \
|
2021-08-18 16:55:05 +02:00
|
|
|
&& ln -s ../Homebrew/bin/brew .linuxbrew/bin/brew \
|
|
|
|
&& git -C .linuxbrew/Homebrew remote set-url origin https://github.com/Homebrew/brew \
|
|
|
|
&& git -C .linuxbrew/Homebrew fetch origin \
|
2020-04-27 22:37:35 -07:00
|
|
|
&& HOMEBREW_NO_ANALYTICS=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/core \
|
2020-04-26 09:55:14 +01:00
|
|
|
&& brew install-bundler-gems \
|
2020-04-27 22:37:35 -07:00
|
|
|
&& brew cleanup \
|
2021-08-18 16:55:05 +02:00
|
|
|
&& { git -C .linuxbrew/Homebrew config --unset gc.auto; true; } \
|
|
|
|
&& { git -C .linuxbrew/Homebrew config --unset homebrew.devcmdrun; true; } \
|
|
|
|
&& rm -rf .cache
|