forked from Homebrew/brew
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
70 lines (66 loc) · 2.12 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
ARG version=22.04
# version is passed through by Docker.
# shellcheck disable=SC2154
FROM ubuntu:"${version}"
ARG DEBIAN_FRONTEND=noninteractive
# We don't want to manually pin versions, happy to use whatever
# Ubuntu thinks is best.
# hadolint ignore=DL3008
# /etc/lsb-release is checked inside the container and sets DISTRIB_RELEASE.
# shellcheck disable=SC1091,SC2154
RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common gnupg-agent \
&& add-apt-repository -y ppa:git-core/ppa \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
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 \
&& apt-get remove --purge -y software-properties-common \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& useradd -m -s /bin/bash linuxbrew \
&& echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers \
&& su - linuxbrew -c 'mkdir ~/.linuxbrew'
USER linuxbrew
COPY --chown=linuxbrew:linuxbrew . /home/linuxbrew/.linuxbrew/Homebrew
ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
WORKDIR /home/linuxbrew
RUN mkdir -p \
.linuxbrew/bin \
.linuxbrew/etc \
.linuxbrew/include \
.linuxbrew/lib \
.linuxbrew/opt \
.linuxbrew/sbin \
.linuxbrew/share \
.linuxbrew/var/homebrew/linked \
.linuxbrew/Cellar \
&& 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 \
&& HOMEBREW_NO_ANALYTICS=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/core \
&& brew install-bundler-gems \
&& brew cleanup \
&& { git -C .linuxbrew/Homebrew config --unset gc.auto; true; } \
&& { git -C .linuxbrew/Homebrew config --unset homebrew.devcmdrun; true; } \
&& rm -rf .cache