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.
							 | 
						
					
						
							
								
									
										
										
										
											2023-03-16 01:19:54 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# We need `[` instead of `[[` because the shell is `/bin/sh`.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# shellcheck disable=SC1091,SC2154,SC2292
							 | 
						
					
						
							
								
									
										
										
										
											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 \
							 | 
						
					
						
							
								
									
										
										
										
											2023-03-24 08:57:48 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  gpg \
							 | 
						
					
						
							
								
									
										
										
										
											2022-12-13 10:40:41 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  less \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  libz-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  locales \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  make \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  netbase \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  openssh-client \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  patch \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  sudo \
							 | 
						
					
						
							
								
									
										
										
										
											2023-03-14 06:53:02 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  unzip \
							 | 
						
					
						
							
								
									
										
										
										
											2022-12-13 10:40:41 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  uuid-runtime \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  tzdata \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  jq \
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-21 17:32:42 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  && if [ "$(. /etc/lsb-release; echo "${DISTRIB_RELEASE}" | cut -d. -f1)" -ge 22 ]; then apt-get install -y --no-install-recommends skopeo; fi \
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-21 18:01:08 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  && curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  && apt-get update \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  && apt-get install -y --no-install-recommends gh \
							 | 
						
					
						
							
								
									
										
										
										
											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/* \
							 | 
						
					
						
							
								
									
										
										
										
											2023-06-01 13:58:33 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  && sed -i -E '/^session optional\s+pam_umask\.so$/ s/$/ umask=0022/' /etc/pam.d/common-session \
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-27 22:37:35 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  && 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
							 |