Skip to content

Commit bf896aa

Browse files
Copilotjeffwidman
andcommitted
Merge the two apt RUN instructions in Dockerfile.updater-core
Co-authored-by: jeffwidman <[email protected]>
1 parent dd1dad4 commit bf896aa

File tree

1 file changed

+30
-36
lines changed

1 file changed

+30
-36
lines changed

Dockerfile.updater-core

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV DEBIAN_FRONTEND="noninteractive" \
1414
# Configures Ubuntu to use Azure mirrors, which are often faster and more reliable
1515
# From https://github.com/Azure/LinuxPatchExtension/blob/master/src/tools/references/apt/sources.list.d/ubuntu.sources
1616
# This is also used in other places such as the runner builds: https://github.com/actions/runner-images/blob/2f8d6ab9ef24fd8bda80b5259650fe1dc4311320/images/ubuntu/scripts/build/configure-apt-sources.sh#L11
17-
RUN set -e; \
18-
release=$( . /etc/os-release && echo "$VERSION_CODENAME" ); \
19-
cat <<EOF | tee /etc/apt/sources.list.d/ubuntu.sources
17+
RUN <<EOT
18+
set -e
19+
release=$( . /etc/os-release && echo "$VERSION_CODENAME" )
20+
cat <<EOF | tee /etc/apt/sources.list.d/ubuntu.sources
2021

2122
# Prefer Azure mirrors
2223
Types: deb
@@ -58,55 +59,48 @@ Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
5859

5960
EOF
6061

61-
RUN apt-get update \
62-
&& apt-get upgrade -y \
63-
&& apt-get install -y --no-install-recommends \
64-
# needed to run add-apt-repository
62+
apt-get update
63+
apt-get upgrade -y
64+
# software-properties-common is needed to run add-apt-repository
65+
# curl is used to download the git-lfs GPG key as well as dev dependencies for CI
66+
apt-get install -y --no-install-recommends \
6567
software-properties-common \
66-
# Used to download the git-lfs GPG key as well as dev dependencies for CI
67-
curl \
68-
# Add git core ppa to get a more recent git version than the one provided by ubuntu
69-
&& add-apt-repository -y ppa:git-core/ppa \
70-
# Install the git-lfs mirror. See https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md
71-
# We need this because the version of git-lfs provided by Ubuntu is outdated
72-
# apt-transport-https is a temporary dependency to install the git-lfs apt source
73-
&& apt-get install -y --no-install-recommends apt-transport-https \
74-
&& mkdir -p /etc/apt/keyrings \
75-
&& curl -fsSL 'https://packagecloud.io/github/git-lfs/gpgkey' | gpg --dearmor > /etc/apt/keyrings/github_git-lfs-archive-keyring.gpg \
76-
&& release=$( . /etc/os-release && echo "$VERSION_CODENAME" ) \
77-
&& echo "deb [signed-by=/etc/apt/keyrings/github_git-lfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/ubuntu/ $release main" \
78-
> /etc/apt/sources.list.d/github_git-lfs.list \
79-
&& echo "deb-src [signed-by=/etc/apt/keyrings/github_git-lfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/ubuntu/ $release main" \
80-
>> /etc/apt/sources.list.d/github_git-lfs.list \
81-
&& apt-get update \
82-
&& apt-get install -y --no-install-recommends \
83-
# dev dependencies for CI
68+
curl
69+
# Add git core ppa to get a more recent git version than the one provided by ubuntu
70+
add-apt-repository -y ppa:git-core/ppa
71+
# Install the git-lfs mirror. See https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md
72+
# We need this because the version of git-lfs provided by Ubuntu is outdated
73+
# apt-transport-https is a temporary dependency to install the git-lfs apt source
74+
apt-get install -y --no-install-recommends apt-transport-https
75+
mkdir -p /etc/apt/keyrings
76+
curl -fsSL 'https://packagecloud.io/github/git-lfs/gpgkey' | gpg --dearmor > /etc/apt/keyrings/github_git-lfs-archive-keyring.gpg
77+
echo "deb [signed-by=/etc/apt/keyrings/github_git-lfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/ubuntu/ $release main" \
78+
> /etc/apt/sources.list.d/github_git-lfs.list
79+
echo "deb-src [signed-by=/etc/apt/keyrings/github_git-lfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/ubuntu/ $release main" \
80+
>> /etc/apt/sources.list.d/github_git-lfs.list
81+
apt-get update
82+
apt-get install -y --no-install-recommends \
8483
build-essential \
8584
libgmp-dev \
86-
# Compression libs
8785
zlib1g-dev \
8886
unzip \
8987
zstd \
90-
# VCS section
9188
git \
9289
git-lfs \
9390
bzr \
9491
mercurial \
95-
# needed to sign commits
9692
gnupg2 \
97-
# for git repo access with ssh key credentials
9893
openssh-client \
99-
# Installs certs in dependabot-action and CLI
10094
ca-certificates \
101-
# used to check if a file is binary in the VendorUpdater
10295
file \
103-
# used by Ruby to parse YAML
10496
libyaml-dev \
105-
locales \
106-
&& locale-gen en_US.UTF-8 \
97+
locales
98+
locale-gen en_US.UTF-8
10799
# No longer needed post git-core ppa addition and git-lfs install
108-
&& apt purge software-properties-common apt-transport-https -y && apt-get autoremove -y \
109-
&& rm -rf /var/lib/apt/lists/*
100+
apt purge software-properties-common apt-transport-https -y
101+
apt-get autoremove -y
102+
rm -rf /var/lib/apt/lists/*
103+
EOT
110104

111105
ARG USER_UID=1000
112106
ARG USER_GID=$USER_UID

0 commit comments

Comments
 (0)