From 74f5abf9d796dcff5d32d4a7baf440632b1da8e0 Mon Sep 17 00:00:00 2001 From: ChendongSun Date: Mon, 4 Nov 2024 07:13:04 +0000 Subject: [PATCH 1/6] omit missing Created field from ImageInspect response Signed-off-by: ChendongSun --- ...-Created-field-from-ImageInspect-res.patch | 69 +++++++++++++++++++ moby.spec | 8 ++- 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 0008-api-omit-missing-Created-field-from-ImageInspect-res.patch diff --git a/0008-api-omit-missing-Created-field-from-ImageInspect-res.patch b/0008-api-omit-missing-Created-field-from-ImageInspect-res.patch new file mode 100644 index 0000000..d769c0e --- /dev/null +++ b/0008-api-omit-missing-Created-field-from-ImageInspect-res.patch @@ -0,0 +1,69 @@ +From 5d9e13bc8453c856f055769008dac9311f43c265 Mon Sep 17 00:00:00 2001 +From: Bjorn Neergaard +Date: Mon, 26 Feb 2024 10:25:08 -0700 +Subject: [PATCH] api: omit missing Created field from ImageInspect response + +Signed-off-by: Bjorn Neergaard +--- + api/swagger.yaml | 6 +++++- + api/types/types.go | 6 +++++- + docs/api/v1.44.yaml | 6 +++++- + 3 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/api/swagger.yaml b/api/swagger.yaml +index e55a76f..350d37a 100644 +--- a/api/swagger.yaml ++++ b/api/swagger.yaml +@@ -1743,8 +1743,12 @@ definitions: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. ++ ++ This information is only available if present in the image, ++ and omitted otherwise. + type: "string" +- x-nullable: false ++ format: "dateTime" ++ x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + Container: + description: | +diff --git a/api/types/types.go b/api/types/types.go +index 5c56a0c..3c1f69a 100644 +--- a/api/types/types.go ++++ b/api/types/types.go +@@ -72,8 +72,12 @@ type ImageInspect struct { + + // Created is the date and time at which the image was created, formatted in + // RFC 3339 nano-seconds (time.RFC3339Nano). +- Created string + ++ // ++ // This information is only available if present in the image, ++ // and omitted otherwise. ++ Created string `json:",omitempty"` ++ + // Container is the ID of the container that was used to create the image. + // + // Depending on how the image was created, this field may be empty. +diff --git a/docs/api/v1.44.yaml b/docs/api/v1.44.yaml +index e55a76f..350d37a 100644 +--- a/docs/api/v1.44.yaml ++++ b/docs/api/v1.44.yaml +@@ -1743,8 +1743,12 @@ definitions: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. ++ ++ This information is only available if present in the image, ++ and omitted otherwise. + type: "string" +- x-nullable: false ++ format: "dateTime" ++ x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + Container: + description: | +-- +2.41.0 + diff --git a/moby.spec b/moby.spec index 7e8231c..7183dde 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: docker Version: 25.0.3 -Release: 14 +Release: 15 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -27,7 +27,7 @@ Patch0004: 0004-fix-docker-swarm-run-failed-for-loongarch64.patch Patch0005: 0005-CVE-2024-41110.patch Patch0006: 0006-tini.c-a-function-declaration-without-a-prototype-is.patch Patch0007: 0007-fix-libnetwork-osl-test-TestAddRemoveInterface.patch - +Patch0008: 0008-api-omit-missing-Created-field-from-ImageInspect-res.patch Requires: %{name}-engine = %{version}-%{release} Requires: %{name}-client = %{version}-%{release} @@ -97,6 +97,7 @@ Docker client binary and related utilities %patch 0004 -p1 %patch 0005 -p1 %patch 0007 -p1 +%patch 0008 -p1 %setup -q -T -n %{_source_docker_init} -b 2 %patch 0006 -p1 @@ -199,6 +200,9 @@ fi %systemd_postun_with_restart docker.service %changelog +* Mon Nov 4 2024 sunchendong - 25.0.3-15 +- DESC:omit missing Created field from ImageInspect response + * Thu Oct 31 2024 yaoguangzhong - 25.0.3-14 - DESC:backport upstream patch to fix libnetwork/osl test TestAddRemoveInterface -- Gitee From 86ec91220a12c96de117711ac36ef64adf46602f Mon Sep 17 00:00:00 2001 From: ChendongSun Date: Wed, 6 Nov 2024 06:29:26 +0000 Subject: [PATCH 2/6] Add container.Output utility Signed-off-by: ChendongSun --- ...gration-Add-container-output-utility.patch | 51 +++++++++++++++++++ moby.spec | 7 ++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 0009-integration-Add-container-output-utility.patch diff --git a/0009-integration-Add-container-output-utility.patch b/0009-integration-Add-container-output-utility.patch new file mode 100644 index 0000000..c4ffdd7 --- /dev/null +++ b/0009-integration-Add-container-output-utility.patch @@ -0,0 +1,51 @@ +From 9ee331235a3affa082d5cb0028351182b89fd123 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= +Date: Thu, 22 Feb 2024 11:14:27 +0100 +Subject: [PATCH] integration: Add container.Output utility +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Extracted from https://github.com/moby/moby/commit/bfb810445c3c111478f5e0e6268ef334c38f38cf + +Signed-off-by: Paweł Gronowski +--- + integration/internal/container/container.go | 25 +++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/integration/internal/container/container.go b/integration/internal/container/container.go +index 0974ce6bf1..dac52999ae 100644 +--- a/integration/internal/container/container.go ++++ b/integration/internal/container/container.go +@@ -170,3 +170,28 @@ func Inspect(ctx context.Context, t *testing.T, apiClient client.APIClient, cont + + return c + } ++ ++type ContainerOutput struct { ++ Stdout, Stderr string ++} ++ ++// Output waits for the container to end running and returns its output. ++func Output(ctx context.Context, client client.APIClient, id string) (ContainerOutput, error) { ++ logs, err := client.ContainerLogs(ctx, id, container.LogsOptions{Follow: true, ShowStdout: true, ShowStderr: true}) ++ if err != nil { ++ return ContainerOutput{}, err ++ } ++ ++ defer logs.Close() ++ ++ var stdoutBuf, stderrBuf bytes.Buffer ++ _, err = stdcopy.StdCopy(&stdoutBuf, &stderrBuf, logs) ++ if err != nil { ++ return ContainerOutput{}, err ++ } ++ ++ return ContainerOutput{ ++ Stdout: stdoutBuf.String(), ++ Stderr: stderrBuf.String(), ++ }, nil ++} +-- +2.33.0 + diff --git a/moby.spec b/moby.spec index 7183dde..d7f41ed 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: docker Version: 25.0.3 -Release: 15 +Release: 16 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -28,6 +28,7 @@ Patch0005: 0005-CVE-2024-41110.patch Patch0006: 0006-tini.c-a-function-declaration-without-a-prototype-is.patch Patch0007: 0007-fix-libnetwork-osl-test-TestAddRemoveInterface.patch Patch0008: 0008-api-omit-missing-Created-field-from-ImageInspect-res.patch +Patch0009: 0009-integration-Add-container-output-utility.patch Requires: %{name}-engine = %{version}-%{release} Requires: %{name}-client = %{version}-%{release} @@ -98,6 +99,7 @@ Docker client binary and related utilities %patch 0005 -p1 %patch 0007 -p1 %patch 0008 -p1 +%patch 0009 -p1 %setup -q -T -n %{_source_docker_init} -b 2 %patch 0006 -p1 @@ -200,6 +202,9 @@ fi %systemd_postun_with_restart docker.service %changelog +* Wed Nov 6 2024 sunchendong - 25.0.3-16 +- DESC:Add container.Output utility + * Mon Nov 4 2024 sunchendong - 25.0.3-15 - DESC:omit missing Created field from ImageInspect response -- Gitee From 578668d15ae1f59e76f86b88f915ba02d00093b2 Mon Sep 17 00:00:00 2001 From: shechenglong Date: Fri, 8 Nov 2024 08:35:12 +0000 Subject: [PATCH 3/6] sync group creation to 24.03-sp1 Signed-off-by: shechenglong --- moby.spec | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/moby.spec b/moby.spec index d7f41ed..68572e3 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: docker Version: 25.0.3 -Release: 16 +Release: 17 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -29,8 +29,8 @@ Patch0006: 0006-tini.c-a-function-declaration-without-a-prototype-is.patch Patch0007: 0007-fix-libnetwork-osl-test-TestAddRemoveInterface.patch Patch0008: 0008-api-omit-missing-Created-field-from-ImageInspect-res.patch Patch0009: 0009-integration-Add-container-output-utility.patch -Requires: %{name}-engine = %{version}-%{release} -Requires: %{name}-client = %{version}-%{release} +Requires(meta): %{name}-engine = %{version}-%{release} +Requires(meta): %{name}-client = %{version}-%{release} # conflicting packages Conflicts: docker-ce @@ -45,7 +45,7 @@ lightweight container. %package engine Summary: Docker daemon binary and related utilities -Requires: /usr/sbin/groupadd +Requires(pre): /usr/sbin/groupadd Requires: runc Requires: container-selinux >= 2:2.74 Requires: libseccomp >= 2.3 @@ -55,6 +55,7 @@ Requires: libcgroup Requires: containerd Requires: tar Requires: xz +%{?systemd_requires} BuildRequires: bash BuildRequires: ca-certificates @@ -189,19 +190,25 @@ install -p -m 644 %{_builddir}/%{_source_client}/{LICENSE,MAINTAINERS,NOTICE,REA %{_datadir}/fish/vendor_completions.d/docker.fish %doc %{_pkgdocdir} -%post -%systemd_post docker.service +%pre engine if ! getent group docker > /dev/null; then groupadd --system docker fi -%preun +%post engine +%systemd_post docker.service + +%preun engine %systemd_preun docker.service docker.socket -%postun +%postun engine %systemd_postun_with_restart docker.service %changelog +* Fri Nov 08 2024 shechenglong - 25.0.3-17 +- DESC: move group creation into pre section rather than post section + change requires into meta dependency for its actual use + * Wed Nov 6 2024 sunchendong - 25.0.3-16 - DESC:Add container.Output utility -- Gitee From 644f0415677e9099fa6f8486095c83960eaf38d9 Mon Sep 17 00:00:00 2001 From: shechenglong Date: Mon, 11 Nov 2024 12:01:44 +0000 Subject: [PATCH 4/6] Don't check source exists with CreateMountpoint Signed-off-by: shechenglong --- ...Don-t-check-source-exists-with-Creat.patch | 37 +++++++++++++++++++ moby.spec | 7 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 0010-mounts-validate-Don-t-check-source-exists-with-Creat.patch diff --git a/0010-mounts-validate-Don-t-check-source-exists-with-Creat.patch b/0010-mounts-validate-Don-t-check-source-exists-with-Creat.patch new file mode 100644 index 0000000..e6ef5b5 --- /dev/null +++ b/0010-mounts-validate-Don-t-check-source-exists-with-Creat.patch @@ -0,0 +1,37 @@ +From a72294a6688d747dcfec8751c3e2616cad703a31 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= +Date: Mon, 19 Feb 2024 15:16:07 +0100 +Subject: [PATCH] mounts/validate: Don't check source exists with + CreateMountpoint +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Don't error out when mount source doesn't exist and mounts has +`CreateMountpoint` option enabled. + +Signed-off-by: Paweł Gronowski +(cherry picked from commit 05b883bdc836a2fd621452f58a2a2c02d253718c) +Signed-off-by: Paweł Gronowski +--- + volume/mounts/linux_parser.go | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/volume/mounts/linux_parser.go b/volume/mounts/linux_parser.go +index 1b64c23935..e7e8ad80f3 100644 +--- a/volume/mounts/linux_parser.go ++++ b/volume/mounts/linux_parser.go +@@ -85,7 +85,9 @@ func (p *linuxParser) validateMountConfigImpl(mnt *mount.Mount, validateBindSour + if err != nil { + return &errMountConfig{mnt, err} + } +- if !exists { ++ ++ createMountpoint := mnt.BindOptions != nil && mnt.BindOptions.CreateMountpoint ++ if !exists && !createMountpoint { + return &errMountConfig{mnt, errBindSourceDoesNotExist(mnt.Source)} + } + } +-- +2.33.0 + diff --git a/moby.spec b/moby.spec index 68572e3..6f879b1 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: docker Version: 25.0.3 -Release: 17 +Release: 18 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -29,6 +29,7 @@ Patch0006: 0006-tini.c-a-function-declaration-without-a-prototype-is.patch Patch0007: 0007-fix-libnetwork-osl-test-TestAddRemoveInterface.patch Patch0008: 0008-api-omit-missing-Created-field-from-ImageInspect-res.patch Patch0009: 0009-integration-Add-container-output-utility.patch +Patch0010: 0010-mounts-validate-Don-t-check-source-exists-with-Creat.patch Requires(meta): %{name}-engine = %{version}-%{release} Requires(meta): %{name}-client = %{version}-%{release} @@ -101,6 +102,7 @@ Docker client binary and related utilities %patch 0007 -p1 %patch 0008 -p1 %patch 0009 -p1 +%patch 0010 -p1 %setup -q -T -n %{_source_docker_init} -b 2 %patch 0006 -p1 @@ -205,6 +207,9 @@ fi %systemd_postun_with_restart docker.service %changelog +* Fri Nov 08 2024 shechenglong - 25.0.3-18 +- DESC: Don't check source exists with CreateMountpoint + * Fri Nov 08 2024 shechenglong - 25.0.3-17 - DESC: move group creation into pre section rather than post section change requires into meta dependency for its actual use -- Gitee From e64d29d70451e051bfa34d29297f2f09a6dfb02f Mon Sep 17 00:00:00 2001 From: shechenglong Date: Thu, 14 Nov 2024 09:37:33 +0000 Subject: [PATCH 5/6] Resolving installation conflicts between docker-engine and libnetwork Signed-off-by: shechenglong --- moby.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/moby.spec b/moby.spec index 6f879b1..fba49db 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: docker Version: 25.0.3 -Release: 18 +Release: 19 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -78,6 +78,7 @@ BuildRequires: systemd-devel BuildRequires: tar BuildRequires: which BuildRequires: golang >= 1.18.0 +BuildRequires: docker-proxy %description engine Docker daemon binary and related utilities @@ -147,7 +148,7 @@ ver="$(%{_builddir}/%{_source_client}/build/docker --version)"; \ install -D -p -m 0755 $(readlink -f %{_builddir}/%{_source_engine}/bundles/dynbinary-daemon/dockerd) %{buildroot}%{_bindir}/dockerd # install proxy -install -D -p -m 0755 %{_builddir}/%{_source_engine}/bundles/dynbinary-daemon/docker-proxy %{buildroot}%{_bindir}/docker-proxy +install -D -p -m 0755 /usr/bin/docker-proxy %{buildroot}%{_bindir}/docker-proxy # install tini install -D -p -m 755 %{_builddir}/%{_source_docker_init}/tini-static %{buildroot}%{_bindir}/docker-init @@ -207,6 +208,9 @@ fi %systemd_postun_with_restart docker.service %changelog +* Thu Nov 14 2024 shechenglong - 25.0.3-19 +- DESC: Resolving installation conflicts between docker-engine and libnetwork + * Fri Nov 08 2024 shechenglong - 25.0.3-18 - DESC: Don't check source exists with CreateMountpoint -- Gitee From 696c7ddfa250ea9b2a613f47af613ff26f0a4375 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Fri, 22 Nov 2024 17:36:06 +0800 Subject: [PATCH 6/6] rename back to moby --- moby.spec | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/moby.spec b/moby.spec index fba49db..5be382b 100644 --- a/moby.spec +++ b/moby.spec @@ -5,9 +5,9 @@ %global _source_docker_init tini-0.19.0 %define _debugsource_template %{nil} -Name: docker +Name: moby Version: 25.0.3 -Release: 19 +Release: 20 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -38,6 +38,8 @@ Conflicts: docker-ce Conflicts: docker-io Conflicts: docker-engine-cs Conflicts: docker-ee +Obsoletes: docker < %{version}-%{release} +Provides: docker = %{version}-%{release} %description Docker is a product for you to build, ship and run any application as a @@ -78,13 +80,16 @@ BuildRequires: systemd-devel BuildRequires: tar BuildRequires: which BuildRequires: golang >= 1.18.0 -BuildRequires: docker-proxy +Obsoletes: docker-engine < %{version}-%{release} +Conflicts: docker-engine >= 2:18 +Requires: libnetwork = %{version}-%{release} %description engine Docker daemon binary and related utilities %package client Summary: Docker client binary and related utilities +Obsoletes: docker-client < %{version}-%{release} Requires: /bin/sh BuildRequires: libtool-ltdl-devel @@ -92,6 +97,15 @@ BuildRequires: libtool-ltdl-devel %description client Docker client binary and related utilities +%package -n libnetwork +Summary: Proxy used for docker port mapping +Provides: docker-proxy +Obsoletes: docker-proxy +Conflicts: docker-engine < 25.0.3-20 + +%description -n libnetwork +Proxy used for docker port mapping. + %prep %setup -q -n %{_source_client} %setup -q -T -n %{_source_engine} -b 1 @@ -148,7 +162,7 @@ ver="$(%{_builddir}/%{_source_client}/build/docker --version)"; \ install -D -p -m 0755 $(readlink -f %{_builddir}/%{_source_engine}/bundles/dynbinary-daemon/dockerd) %{buildroot}%{_bindir}/dockerd # install proxy -install -D -p -m 0755 /usr/bin/docker-proxy %{buildroot}%{_bindir}/docker-proxy +install -D -p -m 0755 %{_builddir}/%{_source_engine}/bundles/dynbinary-daemon/docker-proxy %{buildroot}%{_bindir}/docker-proxy # install tini install -D -p -m 755 %{_builddir}/%{_source_docker_init}/tini-static %{buildroot}%{_bindir}/docker-init @@ -181,11 +195,13 @@ install -p -m 644 %{_builddir}/%{_source_client}/{LICENSE,MAINTAINERS,NOTICE,REA %files engine %config(noreplace) %{_sysconfdir}/sysconfig/docker %{_bindir}/dockerd -%{_bindir}/docker-proxy %{_bindir}/docker-init %{_unitdir}/docker.service %{_unitdir}/docker.socket +%files -n libnetwork +%{_bindir}/docker-proxy + %files client %{_bindir}/docker %{_datadir}/bash-completion/completions/docker @@ -208,6 +224,10 @@ fi %systemd_postun_with_restart docker.service %changelog +* Fri Nov 22 2024 Funda Wang - 25.0.3-20 +- rename back to moby +- split docker-proxy for docker 18 to use + * Thu Nov 14 2024 shechenglong - 25.0.3-19 - DESC: Resolving installation conflicts between docker-engine and libnetwork -- Gitee