Skip to content

Commit 313cced

Browse files
authored
Update Docker to 20.10.14 (#10677)
* Upgrade docker version from 20.10.7 to 20.10.14, and pin containerd.io Update the Docker engine version from 20.10.7 to 20.10.14. This brings in some CVE and bug fixes. Additionally, pin the version of containerd.io to a specific version, mainly for consistency/reproducibility. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com> * Remove the containerd ordering change to docker.service This appears to be already present in the current docker.service. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com> * Remove use of apt-key apt-key is considered deprecated, and the current practice is to just add the key into /etc/apt/trusted.gpg.d/. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com> * Upgrade docker container in Bullseye slave to 20.10.14 Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
1 parent 850e456 commit 313cced

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

build_debian.sh

+5-11
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ set -x -e
3131
CONFIGURED_ARCH=$([ -f .arch ] && cat .arch || echo amd64)
3232

3333
## docker engine version (with platform)
34-
DOCKER_VERSION=5:20.10.7~3-0~debian-$IMAGE_DISTRO
34+
DOCKER_VERSION=5:20.10.14~3-0~debian-$IMAGE_DISTRO
35+
CONTAINERD_IO_VERSION=1.5.11-1
3536
LINUX_KERNEL_VERSION=5.10.0-8-2
3637

3738
## Working directory to prepare the file system
@@ -233,17 +234,12 @@ if [[ $CONFIGURED_ARCH == armhf ]]; then
233234
# update ssl ca certificates for secure pem
234235
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT c_rehash
235236
fi
236-
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/docker.gpg -fsSL https://download.docker.com/linux/debian/gpg
237-
sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add /tmp/docker.gpg
238-
sudo LANG=C chroot $FILESYSTEM_ROOT rm /tmp/docker.gpg
237+
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/docker.asc -fsSL https://download.docker.com/linux/debian/gpg
238+
sudo LANG=C chroot $FILESYSTEM_ROOT mv /tmp/docker.asc /etc/apt/trusted.gpg.d/
239239
sudo LANG=C chroot $FILESYSTEM_ROOT add-apt-repository \
240240
"deb [arch=$CONFIGURED_ARCH] https://download.docker.com/linux/debian $IMAGE_DISTRO stable"
241241
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update
242-
if dpkg --compare-versions ${DOCKER_VERSION} ge "18.09"; then
243-
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION} docker-ce-cli=${DOCKER_VERSION}
244-
else
245-
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION}
246-
fi
242+
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION} docker-ce-cli=${DOCKER_VERSION} containerd.io=${CONTAINERD_IO_VERSION}
247243

248244
# Uninstall 'python3-gi' installed as part of 'software-properties-common' to remove debian version of 'PyGObject'
249245
# pip version of 'PyGObject' will be installed during installation of 'sonic-host-services'
@@ -271,8 +267,6 @@ fi
271267
sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/docker.service.d/
272268
## Note: $_ means last argument of last command
273269
sudo cp files/docker/docker.service.conf $_
274-
## Fix systemd race between docker and containerd
275-
sudo sed -i '/After=/s/$/ containerd.service/' $FILESYSTEM_ROOT/lib/systemd/system/docker.service
276270

277271
## Create default user
278272
## Note: user should be in the group with the same name, and also in sudo/docker/redis groups

sonic-slave-bullseye/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ RUN add-apt-repository \
504504
$(lsb_release -cs) \
505505
stable"
506506
RUN apt-get update
507-
RUN apt-get install -y docker-ce=5:20.10.7~3-0~debian-bullseye docker-ce-cli=5:20.10.7~3-0~debian-bullseye
507+
RUN apt-get install -y docker-ce=5:20.10.14~3-0~debian-bullseye docker-ce-cli=5:20.10.14~3-0~debian-bullseye containerd.io=1.5.11-1
508508
RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker
509509
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy
510510

0 commit comments

Comments
 (0)