diff --git a/apply-patches b/apply-patches deleted file mode 100644 index 325c2c0255c4581ecc80508e6af26bdc089011c9..0000000000000000000000000000000000000000 --- a/apply-patches +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Description: This shell script is used to apply patches for the project -# Author: zhangzhihui@xfusion.com -# Create: 2023-03-27 - -set -ex - -pkg=moby-20.10.24 -cwd=$PWD -src=$cwd/$pkg - -if [ ! -d patch ];then - tar -xzf patch.tar.gz -fi - -cd $src -git init -git add . -git config user.name 'build' -git config user.email 'build@obs.com' -git commit -m "init build" -cd $cwd - -series=$cwd/series.conf -while IPF=read -r line -do - if [[ "$line" =~ ^patch* ]];then - echo git apply $cwd/$line - cd $src && git apply $cwd/$line - fi -done < "$series" - -mv $src/.git $src/git diff --git a/patch/0001-awslogs-fix-non-blocking-log-drop-bug.patch b/awslogs-fix-non-blocking-log-drop-bug.patch similarity index 100% rename from patch/0001-awslogs-fix-non-blocking-log-drop-bug.patch rename to awslogs-fix-non-blocking-log-drop-bug.patch diff --git a/patch/0002-daemon-daemon.prepareMountPoints-fix-panic-if-mount-.patch b/daemon-prepare-MountPoints-fix-panic-if-mount.patch similarity index 65% rename from patch/0002-daemon-daemon.prepareMountPoints-fix-panic-if-mount-.patch rename to daemon-prepare-MountPoints-fix-panic-if-mount.patch index 8d7f6effd5036368e50a8187b931afb4a812f2fd..8e1bee9aeded968f555c0136ad9e87539c61e05a 100644 --- a/patch/0002-daemon-daemon.prepareMountPoints-fix-panic-if-mount-.patch +++ b/daemon-prepare-MountPoints-fix-panic-if-mount.patch @@ -31,14 +31,13 @@ Signed-off-by: Sebastiaan van Stijn Signed-off-by: Cory Snider --- daemon/mounts.go | 4 ++++ - integration/daemon/daemon_test.go | 18 ++++++++++++++++++ - 2 files changed, 22 insertions(+) + 1 files changed, 4 insertions(+) diff --git a/daemon/mounts.go b/daemon/mounts.go index 424e375037..3c79b0d447 100644 --- a/daemon/mounts.go +++ b/daemon/mounts.go -@@ -17,6 +17,10 @@ func (daemon *Daemon) prepareMountPoints(container *container.Container) error { +@@ -15,6 +15,10 @@ func (daemon *Daemon) prepareMountPoints(container *container.Container) error { if err := daemon.lazyInitializeVolume(container.ID, config); err != nil { return err } @@ -46,36 +45,10 @@ index 424e375037..3c79b0d447 100644 + // FIXME(thaJeztah): should we check for config.Type here as well? (i.e., skip bind-mounts etc) + continue + } - if alive { - logrus.WithFields(logrus.Fields{ - "container": container.ID, -diff --git a/integration/daemon/daemon_test.go b/integration/daemon/daemon_test.go -index 47dac3b762..416b19d2b5 100644 ---- a/integration/daemon/daemon_test.go -+++ b/integration/daemon/daemon_test.go -@@ -102,4 +102,22 @@ func testLiveRestoreVolumeReferences(t *testing.T) { - err = c.VolumeRemove(ctx, v.Name, false) - assert.NilError(t, err) - }) -+ -+ // Make sure that we don't panic if the container has bind-mounts -+ // (which should not be "restored") -+ // Regression test for https://github.com/moby/moby/issues/45898 -+ t.Run("container with bind-mounts", func(t *testing.T) { -+ m := mount.Mount{ -+ Type: mount.TypeBind, -+ Source: os.TempDir(), -+ Target: "/foo", -+ } -+ cID := container.Run(ctx, t, c, container.WithMount(m), container.WithCmd("top")) -+ defer c.ContainerRemove(ctx, cID, types.ContainerRemoveOptions{Force: true}) -+ -+ d.Restart(t, "--live-restore", "--iptables=false") -+ -+ err := c.ContainerRemove(ctx, cID, types.ContainerRemoveOptions{Force: true}) -+ assert.NilError(t, err) -+ }) + } + return nil } --- +-- 2.32.0 (Apple Git-132) + diff --git a/libnetwork-dcdf8f17.tar.gz b/libnetwork-dcdf8f17.tar.gz deleted file mode 100644 index f6c37a44c86497323fb2373a55d5c77cdc204c17..0000000000000000000000000000000000000000 Binary files a/libnetwork-dcdf8f17.tar.gz and /dev/null differ diff --git a/moby.spec b/moby.spec index 358a43ec731a043202693404e6cfb04a23e58e9f..7ae9bad1ebe764fff7fb8adeb265387d10c06f59 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: moby Version: 20.10.24 -Release: 4 +Release: 5 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -20,9 +20,8 @@ Source2: tini-0.19.0.tar.gz Source3: docker.service Source4: docker.socket Source5: docker.sysconfig -Source6: apply-patches -Source7: series.conf -Source8: patch.tar.gz +Patch0000: awslogs-fix-non-blocking-log-drop-bug.patch +Patch0001: daemon-prepare-MountPoints-fix-panic-if-mount.patch Requires: %{name}-engine = %{version}-%{release} @@ -92,15 +91,10 @@ Docker client binary and related utilities %prep %setup -q -n %{_source_client} %setup -q -T -n %{_source_engine} -b 1 +%patch0000 -p1 +%patch0001 -p1 %setup -q -T -n %{_source_docker_init} -b 2 -cd %{_builddir} -cp %{SOURCE6} . -cp %{SOURCE7} . -cp %{SOURCE8} . - -sh ./apply-patches - %build export GO111MODULE=off # build docker daemon @@ -200,6 +194,9 @@ fi %systemd_postun_with_restart docker.service %changelog +* Mon Sep 18 2023 xulei - 20.10.24-5 +- Optimize the apply patch method + * Thu Sep 14 2023 xulei - 20.10.24-4 - DESC: Fix missing runc dependencies The declaration conflicts with the installation of docker-engine diff --git a/series.conf b/series.conf deleted file mode 100644 index f5beaceb137dfac4848be1e04565e8e5f4b2f0e8..0000000000000000000000000000000000000000 --- a/series.conf +++ /dev/null @@ -1,2 +0,0 @@ -patch/0001-awslogs-fix-non-blocking-log-drop-bug.patch -patch/0002-daemon-daemon.prepareMountPoints-fix-panic-if-mount-.patch