eclipseo pushed to rpms/golang-github-moby-buildkit (rawhide).
"Update tp 0.10.4 (..more)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-10-22 15:12:16 UTC
From eb632d70f6501bd7ea635b6d632b780cc53e518d Mon Sep 17 00:00:00 2001
From: Robert-André Mauchin <zebob.m(a)gmail.com>
Date: Oct 22 2022 15:11:57 +0000
Subject: Update tp 0.10.4
Close: rhbz#2010717, rhbz#2045544, rhbz#2067399, rhbz#2067431, rhbz#2074260
---
diff --git a/.gitignore b/.gitignore
index bd9d9ca..2eaa35e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
/buildkit-0.8.1.tar.gz
/buildkit-0.8.2.tar.gz
/buildkit-0.9.0.tar.gz
+/buildkit-0.10.4.tar.gz
diff --git a/sources b/sources
index d691434..ee4ce7e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (buildkit-0.9.0.tar.gz) = 435e71c0be0a24694f631c2a4c3b27abdf2de72f644e5afc62a95db9eb6cc5f8bcece7cd2e67c75bae95b2f65e503cc4b073bdab74214366efba2a1073050350
+SHA512 (buildkit-0.10.4.tar.gz) = 14565f6460a485eeb463e47deb56142464524f9268e20551250d74937486a723ee86da61fcaaed5219008ff6f2ec40a2a3da8212a6eeabae31a54cd24e4f04c5
https://src.fedoraproject.org/rpms/golang-github-moby-buildkit/c/eb632d70...
1Â year, 7Â months
ignatenkobrain pushed to rpms/kiwi (f35). "Backport patch for being
able to build OCI containers in Mock (nspawn)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-10-22 15:00:32 UTC
From 1bdb7501e322a0a55616352c11aad134e1c443d7 Mon Sep 17 00:00:00 2001
From: Igor Raits <igor(a)gooddata.com>
Date: Oct 22 2022 09:02:52 +0000
Subject: Backport patch for being able to build OCI containers in Mock (nspawn)
---
diff --git a/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
new file mode 100644
index 0000000..1c1fe56
--- /dev/null
+++ b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
@@ -0,0 +1,126 @@
+From 1f547d6bb994d7d0cbed857b1b8d9b4ec79081be Mon Sep 17 00:00:00 2001
+From: Igor Raits <igor.raits(a)gmail.com>
+Date: Wed, 12 Oct 2022 20:31:54 +0200
+Subject: [PATCH] Stop copying /dev files statically into the OCI container
+
+In containers (nspawn) where part of the /dev filesystem is bind-mounted
+from outside system, kiwi fails to do the rsync (in creation of the
+nodes).
+
+There is no reason to actually copy whole tree inside so let's just
+not do it (as it does not seem to be needed at all).
+---
+ kiwi/container/setup/base.py | 23 -----------------------
+ kiwi/container/setup/oci.py | 1 -
+ test/unit/container/setup/base_test.py | 20 --------------------
+ test/unit/container/setup/oci_test.py | 2 --
+ 4 files changed, 46 deletions(-)
+
+diff --git a/kiwi/container/setup/base.py b/kiwi/container/setup/base.py
+index d2fc56aa66..5a462889d0 100644
+--- a/kiwi/container/setup/base.py
++++ b/kiwi/container/setup/base.py
+@@ -20,7 +20,6 @@
+
+ # project
+ from kiwi.command import Command
+-from kiwi.utils.sync import DataSync
+
+ from kiwi.exceptions import (
+ KiwiContainerSetupError
+@@ -145,28 +144,6 @@ def setup_root_console(self):
+ }
+ )
+
+- def setup_static_device_nodes(self):
+- """
+- Container device node setup
+-
+- Without subsystems like udev running in a container it is
+- required to provide a set of device nodes to let the
+- system in the container function correctly. This is
+- done by syncing the host system nodes to the container.
+- That this will also create device nodes which are not
+- necessarily present in the container later is a know
+- limitation of this method and considered harmless
+- """
+- try:
+- data = DataSync('/dev/', self.root_dir + '/dev/')
+- data.sync_data(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+- except Exception as e:
+- raise KiwiContainerSetupError(
+- 'Failed to create static container nodes %s' % format(e)
+- )
+-
+ def get_container_name(self):
+ """
+ Container name
+diff --git a/kiwi/container/setup/oci.py b/kiwi/container/setup/oci.py
+index 915b56c794..cbc284550e 100644
+--- a/kiwi/container/setup/oci.py
++++ b/kiwi/container/setup/oci.py
+@@ -50,7 +50,6 @@ def setup(self):
+
+ self.deactivate_bootloader_setup()
+ self.deactivate_root_filesystem_check()
+- self.setup_static_device_nodes()
+ self.setup_root_console()
+
+ for service in services_to_deactivate:
+diff --git a/test/unit/container/setup/base_test.py b/test/unit/container/setup/base_test.py
+index b77fa93cd4..d1741c9dbb 100644
+--- a/test/unit/container/setup/base_test.py
++++ b/test/unit/container/setup/base_test.py
+@@ -2,7 +2,6 @@
+ patch, call, mock_open
+ )
+ from pytest import raises
+-import mock
+
+ from kiwi.container.setup.base import ContainerSetupBase
+
+@@ -102,22 +101,3 @@ def test_setup_root_console(self, mock_exists):
+ assert m_open.return_value.write.call_args_list == [
+ call('\nconsole\n')
+ ]
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- @patch('kiwi.container.setup.base.DataSync')
+- def test_setup_static_device_nodes(self, mock_DataSync, mock_command):
+- data = mock.Mock()
+- mock_DataSync.return_value = data
+- self.container.setup_static_device_nodes()
+- mock_DataSync.assert_called_once_with(
+- '/dev/', 'root_dir/dev/'
+- )
+- data.sync_data.assert_called_once_with(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- def test_setup_static_device_nodes_failed(self, mock_command):
+- mock_command.side_effect = Exception
+- with raises(KiwiContainerSetupError):
+- self.container.setup_static_device_nodes()
+diff --git a/test/unit/container/setup/oci_test.py b/test/unit/container/setup/oci_test.py
+index f5ef5022d5..59a1496a29 100644
+--- a/test/unit/container/setup/oci_test.py
++++ b/test/unit/container/setup/oci_test.py
+@@ -16,7 +16,6 @@ def setup(self, mock_exists):
+
+ self.container.deactivate_bootloader_setup = mock.Mock()
+ self.container.deactivate_root_filesystem_check = mock.Mock()
+- self.container.setup_static_device_nodes = mock.Mock()
+ self.container.setup_root_console = mock.Mock()
+ self.container.deactivate_systemd_service = mock.Mock()
+
+@@ -28,7 +27,6 @@ def test_setup(self):
+ self.container.setup()
+ self.container.deactivate_bootloader_setup.assert_called_once_with()
+ self.container.deactivate_root_filesystem_check.assert_called_once_with()
+- self.container.setup_static_device_nodes.assert_called_once_with()
+ assert self.container.deactivate_systemd_service.call_args_list == [
+ call('device-mapper.service'),
+ call('kbd.service'),
diff --git a/kiwi.spec b/kiwi.spec
index e7a36b9..f2903f3 100644
--- a/kiwi.spec
+++ b/kiwi.spec
@@ -12,7 +12,7 @@ and cloud systems like Xen, KVM, VMware, EC2 and more.
Name: kiwi
Version: 9.24.48
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://osinside.github.io/kiwi/
Summary: Flexible operating system image builder
License: GPLv3+
@@ -20,6 +20,7 @@ License: GPLv3+
Source0: https://files.pythonhosted.org/packages/source/k/%{name}/%{name}-%{versio...
# Backports from upstream
+Patch1002: https://github.com/OSInside/kiwi/pull/2195.patch#/0001-Stop-copying-dev-f...
# Fedora-specific patches
## Use buildah instead of umoci by default for OCI image builds
@@ -540,6 +541,9 @@ done
# Empty metapackage
%changelog
+* Sat Oct 22 2022 Igor Raits <igor(a)gooddata.com> - 9.24.48-2
+- Backport patch for being able to build OCI containers in Mock (nspawn)
+
* Wed Sep 14 2022 Neal Gompa <ngompa(a)fedoraproject.org> - 9.24.48-1
- Update to 9.24.48 (RH#2106248)
https://src.fedoraproject.org/rpms/kiwi/c/1bdb7501e322a0a55616352c11aad13...
1Â year, 7Â months
ignatenkobrain pushed to rpms/kiwi (epel9). "Backport patch for
being able to build OCI containers in Mock (nspawn)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-10-22 15:00:17 UTC
From 1bdb7501e322a0a55616352c11aad134e1c443d7 Mon Sep 17 00:00:00 2001
From: Igor Raits <igor(a)gooddata.com>
Date: Oct 22 2022 09:02:52 +0000
Subject: Backport patch for being able to build OCI containers in Mock (nspawn)
---
diff --git a/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
new file mode 100644
index 0000000..1c1fe56
--- /dev/null
+++ b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
@@ -0,0 +1,126 @@
+From 1f547d6bb994d7d0cbed857b1b8d9b4ec79081be Mon Sep 17 00:00:00 2001
+From: Igor Raits <igor.raits(a)gmail.com>
+Date: Wed, 12 Oct 2022 20:31:54 +0200
+Subject: [PATCH] Stop copying /dev files statically into the OCI container
+
+In containers (nspawn) where part of the /dev filesystem is bind-mounted
+from outside system, kiwi fails to do the rsync (in creation of the
+nodes).
+
+There is no reason to actually copy whole tree inside so let's just
+not do it (as it does not seem to be needed at all).
+---
+ kiwi/container/setup/base.py | 23 -----------------------
+ kiwi/container/setup/oci.py | 1 -
+ test/unit/container/setup/base_test.py | 20 --------------------
+ test/unit/container/setup/oci_test.py | 2 --
+ 4 files changed, 46 deletions(-)
+
+diff --git a/kiwi/container/setup/base.py b/kiwi/container/setup/base.py
+index d2fc56aa66..5a462889d0 100644
+--- a/kiwi/container/setup/base.py
++++ b/kiwi/container/setup/base.py
+@@ -20,7 +20,6 @@
+
+ # project
+ from kiwi.command import Command
+-from kiwi.utils.sync import DataSync
+
+ from kiwi.exceptions import (
+ KiwiContainerSetupError
+@@ -145,28 +144,6 @@ def setup_root_console(self):
+ }
+ )
+
+- def setup_static_device_nodes(self):
+- """
+- Container device node setup
+-
+- Without subsystems like udev running in a container it is
+- required to provide a set of device nodes to let the
+- system in the container function correctly. This is
+- done by syncing the host system nodes to the container.
+- That this will also create device nodes which are not
+- necessarily present in the container later is a know
+- limitation of this method and considered harmless
+- """
+- try:
+- data = DataSync('/dev/', self.root_dir + '/dev/')
+- data.sync_data(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+- except Exception as e:
+- raise KiwiContainerSetupError(
+- 'Failed to create static container nodes %s' % format(e)
+- )
+-
+ def get_container_name(self):
+ """
+ Container name
+diff --git a/kiwi/container/setup/oci.py b/kiwi/container/setup/oci.py
+index 915b56c794..cbc284550e 100644
+--- a/kiwi/container/setup/oci.py
++++ b/kiwi/container/setup/oci.py
+@@ -50,7 +50,6 @@ def setup(self):
+
+ self.deactivate_bootloader_setup()
+ self.deactivate_root_filesystem_check()
+- self.setup_static_device_nodes()
+ self.setup_root_console()
+
+ for service in services_to_deactivate:
+diff --git a/test/unit/container/setup/base_test.py b/test/unit/container/setup/base_test.py
+index b77fa93cd4..d1741c9dbb 100644
+--- a/test/unit/container/setup/base_test.py
++++ b/test/unit/container/setup/base_test.py
+@@ -2,7 +2,6 @@
+ patch, call, mock_open
+ )
+ from pytest import raises
+-import mock
+
+ from kiwi.container.setup.base import ContainerSetupBase
+
+@@ -102,22 +101,3 @@ def test_setup_root_console(self, mock_exists):
+ assert m_open.return_value.write.call_args_list == [
+ call('\nconsole\n')
+ ]
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- @patch('kiwi.container.setup.base.DataSync')
+- def test_setup_static_device_nodes(self, mock_DataSync, mock_command):
+- data = mock.Mock()
+- mock_DataSync.return_value = data
+- self.container.setup_static_device_nodes()
+- mock_DataSync.assert_called_once_with(
+- '/dev/', 'root_dir/dev/'
+- )
+- data.sync_data.assert_called_once_with(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- def test_setup_static_device_nodes_failed(self, mock_command):
+- mock_command.side_effect = Exception
+- with raises(KiwiContainerSetupError):
+- self.container.setup_static_device_nodes()
+diff --git a/test/unit/container/setup/oci_test.py b/test/unit/container/setup/oci_test.py
+index f5ef5022d5..59a1496a29 100644
+--- a/test/unit/container/setup/oci_test.py
++++ b/test/unit/container/setup/oci_test.py
+@@ -16,7 +16,6 @@ def setup(self, mock_exists):
+
+ self.container.deactivate_bootloader_setup = mock.Mock()
+ self.container.deactivate_root_filesystem_check = mock.Mock()
+- self.container.setup_static_device_nodes = mock.Mock()
+ self.container.setup_root_console = mock.Mock()
+ self.container.deactivate_systemd_service = mock.Mock()
+
+@@ -28,7 +27,6 @@ def test_setup(self):
+ self.container.setup()
+ self.container.deactivate_bootloader_setup.assert_called_once_with()
+ self.container.deactivate_root_filesystem_check.assert_called_once_with()
+- self.container.setup_static_device_nodes.assert_called_once_with()
+ assert self.container.deactivate_systemd_service.call_args_list == [
+ call('device-mapper.service'),
+ call('kbd.service'),
diff --git a/kiwi.spec b/kiwi.spec
index e7a36b9..f2903f3 100644
--- a/kiwi.spec
+++ b/kiwi.spec
@@ -12,7 +12,7 @@ and cloud systems like Xen, KVM, VMware, EC2 and more.
Name: kiwi
Version: 9.24.48
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://osinside.github.io/kiwi/
Summary: Flexible operating system image builder
License: GPLv3+
@@ -20,6 +20,7 @@ License: GPLv3+
Source0: https://files.pythonhosted.org/packages/source/k/%{name}/%{name}-%{versio...
# Backports from upstream
+Patch1002: https://github.com/OSInside/kiwi/pull/2195.patch#/0001-Stop-copying-dev-f...
# Fedora-specific patches
## Use buildah instead of umoci by default for OCI image builds
@@ -540,6 +541,9 @@ done
# Empty metapackage
%changelog
+* Sat Oct 22 2022 Igor Raits <igor(a)gooddata.com> - 9.24.48-2
+- Backport patch for being able to build OCI containers in Mock (nspawn)
+
* Wed Sep 14 2022 Neal Gompa <ngompa(a)fedoraproject.org> - 9.24.48-1
- Update to 9.24.48 (RH#2106248)
https://src.fedoraproject.org/rpms/kiwi/c/1bdb7501e322a0a55616352c11aad13...
1Â year, 7Â months
ignatenkobrain pushed to rpms/kiwi (epel8). "Backport patch for
being able to build OCI containers in Mock (nspawn)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-10-22 15:00:06 UTC
From 1bdb7501e322a0a55616352c11aad134e1c443d7 Mon Sep 17 00:00:00 2001
From: Igor Raits <igor(a)gooddata.com>
Date: Oct 22 2022 09:02:52 +0000
Subject: Backport patch for being able to build OCI containers in Mock (nspawn)
---
diff --git a/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
new file mode 100644
index 0000000..1c1fe56
--- /dev/null
+++ b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
@@ -0,0 +1,126 @@
+From 1f547d6bb994d7d0cbed857b1b8d9b4ec79081be Mon Sep 17 00:00:00 2001
+From: Igor Raits <igor.raits(a)gmail.com>
+Date: Wed, 12 Oct 2022 20:31:54 +0200
+Subject: [PATCH] Stop copying /dev files statically into the OCI container
+
+In containers (nspawn) where part of the /dev filesystem is bind-mounted
+from outside system, kiwi fails to do the rsync (in creation of the
+nodes).
+
+There is no reason to actually copy whole tree inside so let's just
+not do it (as it does not seem to be needed at all).
+---
+ kiwi/container/setup/base.py | 23 -----------------------
+ kiwi/container/setup/oci.py | 1 -
+ test/unit/container/setup/base_test.py | 20 --------------------
+ test/unit/container/setup/oci_test.py | 2 --
+ 4 files changed, 46 deletions(-)
+
+diff --git a/kiwi/container/setup/base.py b/kiwi/container/setup/base.py
+index d2fc56aa66..5a462889d0 100644
+--- a/kiwi/container/setup/base.py
++++ b/kiwi/container/setup/base.py
+@@ -20,7 +20,6 @@
+
+ # project
+ from kiwi.command import Command
+-from kiwi.utils.sync import DataSync
+
+ from kiwi.exceptions import (
+ KiwiContainerSetupError
+@@ -145,28 +144,6 @@ def setup_root_console(self):
+ }
+ )
+
+- def setup_static_device_nodes(self):
+- """
+- Container device node setup
+-
+- Without subsystems like udev running in a container it is
+- required to provide a set of device nodes to let the
+- system in the container function correctly. This is
+- done by syncing the host system nodes to the container.
+- That this will also create device nodes which are not
+- necessarily present in the container later is a know
+- limitation of this method and considered harmless
+- """
+- try:
+- data = DataSync('/dev/', self.root_dir + '/dev/')
+- data.sync_data(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+- except Exception as e:
+- raise KiwiContainerSetupError(
+- 'Failed to create static container nodes %s' % format(e)
+- )
+-
+ def get_container_name(self):
+ """
+ Container name
+diff --git a/kiwi/container/setup/oci.py b/kiwi/container/setup/oci.py
+index 915b56c794..cbc284550e 100644
+--- a/kiwi/container/setup/oci.py
++++ b/kiwi/container/setup/oci.py
+@@ -50,7 +50,6 @@ def setup(self):
+
+ self.deactivate_bootloader_setup()
+ self.deactivate_root_filesystem_check()
+- self.setup_static_device_nodes()
+ self.setup_root_console()
+
+ for service in services_to_deactivate:
+diff --git a/test/unit/container/setup/base_test.py b/test/unit/container/setup/base_test.py
+index b77fa93cd4..d1741c9dbb 100644
+--- a/test/unit/container/setup/base_test.py
++++ b/test/unit/container/setup/base_test.py
+@@ -2,7 +2,6 @@
+ patch, call, mock_open
+ )
+ from pytest import raises
+-import mock
+
+ from kiwi.container.setup.base import ContainerSetupBase
+
+@@ -102,22 +101,3 @@ def test_setup_root_console(self, mock_exists):
+ assert m_open.return_value.write.call_args_list == [
+ call('\nconsole\n')
+ ]
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- @patch('kiwi.container.setup.base.DataSync')
+- def test_setup_static_device_nodes(self, mock_DataSync, mock_command):
+- data = mock.Mock()
+- mock_DataSync.return_value = data
+- self.container.setup_static_device_nodes()
+- mock_DataSync.assert_called_once_with(
+- '/dev/', 'root_dir/dev/'
+- )
+- data.sync_data.assert_called_once_with(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- def test_setup_static_device_nodes_failed(self, mock_command):
+- mock_command.side_effect = Exception
+- with raises(KiwiContainerSetupError):
+- self.container.setup_static_device_nodes()
+diff --git a/test/unit/container/setup/oci_test.py b/test/unit/container/setup/oci_test.py
+index f5ef5022d5..59a1496a29 100644
+--- a/test/unit/container/setup/oci_test.py
++++ b/test/unit/container/setup/oci_test.py
+@@ -16,7 +16,6 @@ def setup(self, mock_exists):
+
+ self.container.deactivate_bootloader_setup = mock.Mock()
+ self.container.deactivate_root_filesystem_check = mock.Mock()
+- self.container.setup_static_device_nodes = mock.Mock()
+ self.container.setup_root_console = mock.Mock()
+ self.container.deactivate_systemd_service = mock.Mock()
+
+@@ -28,7 +27,6 @@ def test_setup(self):
+ self.container.setup()
+ self.container.deactivate_bootloader_setup.assert_called_once_with()
+ self.container.deactivate_root_filesystem_check.assert_called_once_with()
+- self.container.setup_static_device_nodes.assert_called_once_with()
+ assert self.container.deactivate_systemd_service.call_args_list == [
+ call('device-mapper.service'),
+ call('kbd.service'),
diff --git a/kiwi.spec b/kiwi.spec
index e7a36b9..f2903f3 100644
--- a/kiwi.spec
+++ b/kiwi.spec
@@ -12,7 +12,7 @@ and cloud systems like Xen, KVM, VMware, EC2 and more.
Name: kiwi
Version: 9.24.48
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://osinside.github.io/kiwi/
Summary: Flexible operating system image builder
License: GPLv3+
@@ -20,6 +20,7 @@ License: GPLv3+
Source0: https://files.pythonhosted.org/packages/source/k/%{name}/%{name}-%{versio...
# Backports from upstream
+Patch1002: https://github.com/OSInside/kiwi/pull/2195.patch#/0001-Stop-copying-dev-f...
# Fedora-specific patches
## Use buildah instead of umoci by default for OCI image builds
@@ -540,6 +541,9 @@ done
# Empty metapackage
%changelog
+* Sat Oct 22 2022 Igor Raits <igor(a)gooddata.com> - 9.24.48-2
+- Backport patch for being able to build OCI containers in Mock (nspawn)
+
* Wed Sep 14 2022 Neal Gompa <ngompa(a)fedoraproject.org> - 9.24.48-1
- Update to 9.24.48 (RH#2106248)
https://src.fedoraproject.org/rpms/kiwi/c/1bdb7501e322a0a55616352c11aad13...
1Â year, 7Â months
ignatenkobrain pushed to rpms/kiwi (f36). "Backport patch for being
able to build OCI containers in Mock (nspawn)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-10-22 14:59:38 UTC
From 1bdb7501e322a0a55616352c11aad134e1c443d7 Mon Sep 17 00:00:00 2001
From: Igor Raits <igor(a)gooddata.com>
Date: Oct 22 2022 09:02:52 +0000
Subject: Backport patch for being able to build OCI containers in Mock (nspawn)
---
diff --git a/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
new file mode 100644
index 0000000..1c1fe56
--- /dev/null
+++ b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
@@ -0,0 +1,126 @@
+From 1f547d6bb994d7d0cbed857b1b8d9b4ec79081be Mon Sep 17 00:00:00 2001
+From: Igor Raits <igor.raits(a)gmail.com>
+Date: Wed, 12 Oct 2022 20:31:54 +0200
+Subject: [PATCH] Stop copying /dev files statically into the OCI container
+
+In containers (nspawn) where part of the /dev filesystem is bind-mounted
+from outside system, kiwi fails to do the rsync (in creation of the
+nodes).
+
+There is no reason to actually copy whole tree inside so let's just
+not do it (as it does not seem to be needed at all).
+---
+ kiwi/container/setup/base.py | 23 -----------------------
+ kiwi/container/setup/oci.py | 1 -
+ test/unit/container/setup/base_test.py | 20 --------------------
+ test/unit/container/setup/oci_test.py | 2 --
+ 4 files changed, 46 deletions(-)
+
+diff --git a/kiwi/container/setup/base.py b/kiwi/container/setup/base.py
+index d2fc56aa66..5a462889d0 100644
+--- a/kiwi/container/setup/base.py
++++ b/kiwi/container/setup/base.py
+@@ -20,7 +20,6 @@
+
+ # project
+ from kiwi.command import Command
+-from kiwi.utils.sync import DataSync
+
+ from kiwi.exceptions import (
+ KiwiContainerSetupError
+@@ -145,28 +144,6 @@ def setup_root_console(self):
+ }
+ )
+
+- def setup_static_device_nodes(self):
+- """
+- Container device node setup
+-
+- Without subsystems like udev running in a container it is
+- required to provide a set of device nodes to let the
+- system in the container function correctly. This is
+- done by syncing the host system nodes to the container.
+- That this will also create device nodes which are not
+- necessarily present in the container later is a know
+- limitation of this method and considered harmless
+- """
+- try:
+- data = DataSync('/dev/', self.root_dir + '/dev/')
+- data.sync_data(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+- except Exception as e:
+- raise KiwiContainerSetupError(
+- 'Failed to create static container nodes %s' % format(e)
+- )
+-
+ def get_container_name(self):
+ """
+ Container name
+diff --git a/kiwi/container/setup/oci.py b/kiwi/container/setup/oci.py
+index 915b56c794..cbc284550e 100644
+--- a/kiwi/container/setup/oci.py
++++ b/kiwi/container/setup/oci.py
+@@ -50,7 +50,6 @@ def setup(self):
+
+ self.deactivate_bootloader_setup()
+ self.deactivate_root_filesystem_check()
+- self.setup_static_device_nodes()
+ self.setup_root_console()
+
+ for service in services_to_deactivate:
+diff --git a/test/unit/container/setup/base_test.py b/test/unit/container/setup/base_test.py
+index b77fa93cd4..d1741c9dbb 100644
+--- a/test/unit/container/setup/base_test.py
++++ b/test/unit/container/setup/base_test.py
+@@ -2,7 +2,6 @@
+ patch, call, mock_open
+ )
+ from pytest import raises
+-import mock
+
+ from kiwi.container.setup.base import ContainerSetupBase
+
+@@ -102,22 +101,3 @@ def test_setup_root_console(self, mock_exists):
+ assert m_open.return_value.write.call_args_list == [
+ call('\nconsole\n')
+ ]
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- @patch('kiwi.container.setup.base.DataSync')
+- def test_setup_static_device_nodes(self, mock_DataSync, mock_command):
+- data = mock.Mock()
+- mock_DataSync.return_value = data
+- self.container.setup_static_device_nodes()
+- mock_DataSync.assert_called_once_with(
+- '/dev/', 'root_dir/dev/'
+- )
+- data.sync_data.assert_called_once_with(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- def test_setup_static_device_nodes_failed(self, mock_command):
+- mock_command.side_effect = Exception
+- with raises(KiwiContainerSetupError):
+- self.container.setup_static_device_nodes()
+diff --git a/test/unit/container/setup/oci_test.py b/test/unit/container/setup/oci_test.py
+index f5ef5022d5..59a1496a29 100644
+--- a/test/unit/container/setup/oci_test.py
++++ b/test/unit/container/setup/oci_test.py
+@@ -16,7 +16,6 @@ def setup(self, mock_exists):
+
+ self.container.deactivate_bootloader_setup = mock.Mock()
+ self.container.deactivate_root_filesystem_check = mock.Mock()
+- self.container.setup_static_device_nodes = mock.Mock()
+ self.container.setup_root_console = mock.Mock()
+ self.container.deactivate_systemd_service = mock.Mock()
+
+@@ -28,7 +27,6 @@ def test_setup(self):
+ self.container.setup()
+ self.container.deactivate_bootloader_setup.assert_called_once_with()
+ self.container.deactivate_root_filesystem_check.assert_called_once_with()
+- self.container.setup_static_device_nodes.assert_called_once_with()
+ assert self.container.deactivate_systemd_service.call_args_list == [
+ call('device-mapper.service'),
+ call('kbd.service'),
diff --git a/kiwi.spec b/kiwi.spec
index e7a36b9..f2903f3 100644
--- a/kiwi.spec
+++ b/kiwi.spec
@@ -12,7 +12,7 @@ and cloud systems like Xen, KVM, VMware, EC2 and more.
Name: kiwi
Version: 9.24.48
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://osinside.github.io/kiwi/
Summary: Flexible operating system image builder
License: GPLv3+
@@ -20,6 +20,7 @@ License: GPLv3+
Source0: https://files.pythonhosted.org/packages/source/k/%{name}/%{name}-%{versio...
# Backports from upstream
+Patch1002: https://github.com/OSInside/kiwi/pull/2195.patch#/0001-Stop-copying-dev-f...
# Fedora-specific patches
## Use buildah instead of umoci by default for OCI image builds
@@ -540,6 +541,9 @@ done
# Empty metapackage
%changelog
+* Sat Oct 22 2022 Igor Raits <igor(a)gooddata.com> - 9.24.48-2
+- Backport patch for being able to build OCI containers in Mock (nspawn)
+
* Wed Sep 14 2022 Neal Gompa <ngompa(a)fedoraproject.org> - 9.24.48-1
- Update to 9.24.48 (RH#2106248)
https://src.fedoraproject.org/rpms/kiwi/c/1bdb7501e322a0a55616352c11aad13...
1Â year, 7Â months
ignatenkobrain pushed to rpms/kiwi (f37). "Backport patch for being
able to build OCI containers in Mock (nspawn)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-10-22 14:59:50 UTC
From 1bdb7501e322a0a55616352c11aad134e1c443d7 Mon Sep 17 00:00:00 2001
From: Igor Raits <igor(a)gooddata.com>
Date: Oct 22 2022 09:02:52 +0000
Subject: Backport patch for being able to build OCI containers in Mock (nspawn)
---
diff --git a/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
new file mode 100644
index 0000000..1c1fe56
--- /dev/null
+++ b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
@@ -0,0 +1,126 @@
+From 1f547d6bb994d7d0cbed857b1b8d9b4ec79081be Mon Sep 17 00:00:00 2001
+From: Igor Raits <igor.raits(a)gmail.com>
+Date: Wed, 12 Oct 2022 20:31:54 +0200
+Subject: [PATCH] Stop copying /dev files statically into the OCI container
+
+In containers (nspawn) where part of the /dev filesystem is bind-mounted
+from outside system, kiwi fails to do the rsync (in creation of the
+nodes).
+
+There is no reason to actually copy whole tree inside so let's just
+not do it (as it does not seem to be needed at all).
+---
+ kiwi/container/setup/base.py | 23 -----------------------
+ kiwi/container/setup/oci.py | 1 -
+ test/unit/container/setup/base_test.py | 20 --------------------
+ test/unit/container/setup/oci_test.py | 2 --
+ 4 files changed, 46 deletions(-)
+
+diff --git a/kiwi/container/setup/base.py b/kiwi/container/setup/base.py
+index d2fc56aa66..5a462889d0 100644
+--- a/kiwi/container/setup/base.py
++++ b/kiwi/container/setup/base.py
+@@ -20,7 +20,6 @@
+
+ # project
+ from kiwi.command import Command
+-from kiwi.utils.sync import DataSync
+
+ from kiwi.exceptions import (
+ KiwiContainerSetupError
+@@ -145,28 +144,6 @@ def setup_root_console(self):
+ }
+ )
+
+- def setup_static_device_nodes(self):
+- """
+- Container device node setup
+-
+- Without subsystems like udev running in a container it is
+- required to provide a set of device nodes to let the
+- system in the container function correctly. This is
+- done by syncing the host system nodes to the container.
+- That this will also create device nodes which are not
+- necessarily present in the container later is a know
+- limitation of this method and considered harmless
+- """
+- try:
+- data = DataSync('/dev/', self.root_dir + '/dev/')
+- data.sync_data(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+- except Exception as e:
+- raise KiwiContainerSetupError(
+- 'Failed to create static container nodes %s' % format(e)
+- )
+-
+ def get_container_name(self):
+ """
+ Container name
+diff --git a/kiwi/container/setup/oci.py b/kiwi/container/setup/oci.py
+index 915b56c794..cbc284550e 100644
+--- a/kiwi/container/setup/oci.py
++++ b/kiwi/container/setup/oci.py
+@@ -50,7 +50,6 @@ def setup(self):
+
+ self.deactivate_bootloader_setup()
+ self.deactivate_root_filesystem_check()
+- self.setup_static_device_nodes()
+ self.setup_root_console()
+
+ for service in services_to_deactivate:
+diff --git a/test/unit/container/setup/base_test.py b/test/unit/container/setup/base_test.py
+index b77fa93cd4..d1741c9dbb 100644
+--- a/test/unit/container/setup/base_test.py
++++ b/test/unit/container/setup/base_test.py
+@@ -2,7 +2,6 @@
+ patch, call, mock_open
+ )
+ from pytest import raises
+-import mock
+
+ from kiwi.container.setup.base import ContainerSetupBase
+
+@@ -102,22 +101,3 @@ def test_setup_root_console(self, mock_exists):
+ assert m_open.return_value.write.call_args_list == [
+ call('\nconsole\n')
+ ]
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- @patch('kiwi.container.setup.base.DataSync')
+- def test_setup_static_device_nodes(self, mock_DataSync, mock_command):
+- data = mock.Mock()
+- mock_DataSync.return_value = data
+- self.container.setup_static_device_nodes()
+- mock_DataSync.assert_called_once_with(
+- '/dev/', 'root_dir/dev/'
+- )
+- data.sync_data.assert_called_once_with(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- def test_setup_static_device_nodes_failed(self, mock_command):
+- mock_command.side_effect = Exception
+- with raises(KiwiContainerSetupError):
+- self.container.setup_static_device_nodes()
+diff --git a/test/unit/container/setup/oci_test.py b/test/unit/container/setup/oci_test.py
+index f5ef5022d5..59a1496a29 100644
+--- a/test/unit/container/setup/oci_test.py
++++ b/test/unit/container/setup/oci_test.py
+@@ -16,7 +16,6 @@ def setup(self, mock_exists):
+
+ self.container.deactivate_bootloader_setup = mock.Mock()
+ self.container.deactivate_root_filesystem_check = mock.Mock()
+- self.container.setup_static_device_nodes = mock.Mock()
+ self.container.setup_root_console = mock.Mock()
+ self.container.deactivate_systemd_service = mock.Mock()
+
+@@ -28,7 +27,6 @@ def test_setup(self):
+ self.container.setup()
+ self.container.deactivate_bootloader_setup.assert_called_once_with()
+ self.container.deactivate_root_filesystem_check.assert_called_once_with()
+- self.container.setup_static_device_nodes.assert_called_once_with()
+ assert self.container.deactivate_systemd_service.call_args_list == [
+ call('device-mapper.service'),
+ call('kbd.service'),
diff --git a/kiwi.spec b/kiwi.spec
index e7a36b9..f2903f3 100644
--- a/kiwi.spec
+++ b/kiwi.spec
@@ -12,7 +12,7 @@ and cloud systems like Xen, KVM, VMware, EC2 and more.
Name: kiwi
Version: 9.24.48
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://osinside.github.io/kiwi/
Summary: Flexible operating system image builder
License: GPLv3+
@@ -20,6 +20,7 @@ License: GPLv3+
Source0: https://files.pythonhosted.org/packages/source/k/%{name}/%{name}-%{versio...
# Backports from upstream
+Patch1002: https://github.com/OSInside/kiwi/pull/2195.patch#/0001-Stop-copying-dev-f...
# Fedora-specific patches
## Use buildah instead of umoci by default for OCI image builds
@@ -540,6 +541,9 @@ done
# Empty metapackage
%changelog
+* Sat Oct 22 2022 Igor Raits <igor(a)gooddata.com> - 9.24.48-2
+- Backport patch for being able to build OCI containers in Mock (nspawn)
+
* Wed Sep 14 2022 Neal Gompa <ngompa(a)fedoraproject.org> - 9.24.48-1
- Update to 9.24.48 (RH#2106248)
https://src.fedoraproject.org/rpms/kiwi/c/1bdb7501e322a0a55616352c11aad13...
1Â year, 7Â months
eclipseo pushed to rpms/golang-github-docker (rawhide). "Update to
22.06.0~beta.0 (..more)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-10-22 14:59:48 UTC
From 235c3e3ffc356037b4b3796241f87eee0aa7b14c Mon Sep 17 00:00:00 2001
From: Robert-André Mauchin <zebob.m(a)gmail.com>
Date: Oct 22 2022 14:59:30 +0000
Subject: Update to 22.06.0~beta.0
Bootstrap
---
diff --git a/.gitignore b/.gitignore
index 551a0e3..d33d7b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
/moby-20.10.5.tar.gz
/moby-20.10.6.tar.gz
/moby-20.10.12.tar.gz
+/moby-22.06.0-beta.0.tar.gz
diff --git a/0001-Revert-backend-add-StopOptions-to-ContainerRestart-a.patch b/0001-Revert-backend-add-StopOptions-to-ContainerRestart-a.patch
new file mode 100644
index 0000000..20e8c03
--- /dev/null
+++ b/0001-Revert-backend-add-StopOptions-to-ContainerRestart-a.patch
@@ -0,0 +1,634 @@
+From fdd5cce00433e36feb123a60f2fb447b19b40e59 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m(a)gmail.com>
+Date: Sun, 9 Oct 2022 14:50:08 +0200
+Subject: [PATCH 1/3] Revert "backend: add StopOptions to ContainerRestart and
+ ContainerStop"
+
+This reverts commit 90de570cfa5f6de0b02bdf2e794627fbf5b0dfc8.
+---
+ ...dd-StopOptions-to-ContainerRestart-a.patch | 317 ++++++++++++++++++
+ api/server/router/container/backend.go | 4 +-
+ .../router/container/container_routes.go | 24 +-
+ api/types/container/config.go | 18 -
+ daemon/cluster/executor/backend.go | 4 +-
+ daemon/cluster/executor/container/adapter.go | 11 +-
+ daemon/daemon.go | 2 +-
+ daemon/delete.go | 4 +-
+ daemon/restart.go | 9 +-
+ daemon/stop.go | 20 +-
+ 10 files changed, 346 insertions(+), 67 deletions(-)
+ create mode 100644 0001-Revert-backend-add-StopOptions-to-ContainerRestart-a.patch
+
+diff --git a/0001-Revert-backend-add-StopOptions-to-ContainerRestart-a.patch b/0001-Revert-backend-add-StopOptions-to-ContainerRestart-a.patch
+new file mode 100644
+index 0000000000..f1fbd662bc
+--- /dev/null
++++ b/0001-Revert-backend-add-StopOptions-to-ContainerRestart-a.patch
+@@ -0,0 +1,317 @@
++From 9424b7c3bc59d77bfc744a2ab935ffd1fd47de32 Mon Sep 17 00:00:00 2001
++From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m(a)gmail.com>
++Date: Sun, 9 Oct 2022 14:38:25 +0200
++Subject: [PATCH] Revert "backend: add StopOptions to ContainerRestart and
++ ContainerStop"
++
++This reverts commit 90de570cfa5f6de0b02bdf2e794627fbf5b0dfc8.
++---
++ api/server/router/container/backend.go | 4 ++--
++ .../router/container/container_routes.go | 24 +++++--------------
++ api/types/container/config.go | 18 --------------
++ daemon/cluster/executor/backend.go | 4 ++--
++ daemon/cluster/executor/container/adapter.go | 11 +++++----
++ daemon/daemon.go | 2 +-
++ daemon/delete.go | 4 +---
++ daemon/restart.go | 17 +++++++++----
++ daemon/stop.go | 20 ++++++----------
++ 9 files changed, 37 insertions(+), 67 deletions(-)
++
++diff --git a/api/server/router/container/backend.go b/api/server/router/container/backend.go
++index 4db989a102..8d5c8bd6c9 100644
++--- a/api/server/router/container/backend.go
+++++ b/api/server/router/container/backend.go
++@@ -37,10 +37,10 @@ type stateBackend interface {
++ ContainerPause(name string) error
++ ContainerRename(oldName, newName string) error
++ ContainerResize(name string, height, width int) error
++- ContainerRestart(ctx context.Context, name string, options container.StopOptions) error
+++ ContainerRestart(name string, seconds *int) error
++ ContainerRm(name string, config *types.ContainerRmConfig) error
++ ContainerStart(name string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error
++- ContainerStop(ctx context.Context, name string, options container.StopOptions) error
+++ ContainerStop(name string, seconds *int) error
++ ContainerUnpause(name string) error
++ ContainerUpdate(name string, hostConfig *container.HostConfig) (container.ContainerUpdateOKBody, error)
++ ContainerWait(ctx context.Context, name string, condition containerpkg.WaitCondition) (<-chan containerpkg.StateStatus, error)
++diff --git a/api/server/router/container/container_routes.go b/api/server/router/container/container_routes.go
++index 6670b9ec68..c5b72c9ff7 100644
++--- a/api/server/router/container/container_routes.go
+++++ b/api/server/router/container/container_routes.go
++@@ -227,22 +227,16 @@ func (s *containerRouter) postContainersStop(ctx context.Context, w http.Respons
++ return err
++ }
++
++- var (
++- options container.StopOptions
++- version = httputils.VersionFromContext(ctx)
++- )
++- if versions.GreaterThanOrEqualTo(version, "1.42") {
++- options.Signal = r.Form.Get("signal")
++- }
+++ var seconds *int
++ if tmpSeconds := r.Form.Get("t"); tmpSeconds != "" {
++ valSeconds, err := strconv.Atoi(tmpSeconds)
++ if err != nil {
++ return err
++ }
++- options.Timeout = &valSeconds
+++ seconds = &valSeconds
++ }
++
++- if err := s.backend.ContainerStop(ctx, vars["name"], options); err != nil {
+++ if err := s.backend.ContainerStop(vars["name"], seconds); err != nil {
++ return err
++ }
++
++@@ -280,22 +274,16 @@ func (s *containerRouter) postContainersRestart(ctx context.Context, w http.Resp
++ return err
++ }
++
++- var (
++- options container.StopOptions
++- version = httputils.VersionFromContext(ctx)
++- )
++- if versions.GreaterThanOrEqualTo(version, "1.42") {
++- options.Signal = r.Form.Get("signal")
++- }
+++ var seconds *int
++ if tmpSeconds := r.Form.Get("t"); tmpSeconds != "" {
++ valSeconds, err := strconv.Atoi(tmpSeconds)
++ if err != nil {
++ return err
++ }
++- options.Timeout = &valSeconds
+++ seconds = &valSeconds
++ }
++
++- if err := s.backend.ContainerRestart(ctx, vars["name"], options); err != nil {
+++ if err := s.backend.ContainerRestart(vars["name"], seconds); err != nil {
++ return err
++ }
++
++diff --git a/api/types/container/config.go b/api/types/container/config.go
++index 077583e66c..0461a69ab6 100644
++--- a/api/types/container/config.go
+++++ b/api/types/container/config.go
++@@ -14,24 +14,6 @@ import (
++ // Docker interprets it as 3 nanoseconds.
++ const MinimumDuration = 1 * time.Millisecond
++
++-// StopOptions holds the options to stop or restart a container.
++-type StopOptions struct {
++- // Signal (optional) is the signal to send to the container to (gracefully)
++- // stop it before forcibly terminating the container with SIGKILL after the
++- // timeout expires. If not value is set, the default (SIGTERM) is used.
++- Signal string `json:",omitempty"`
++-
++- // Timeout (optional) is the timeout (in seconds) to wait for the container
++- // to stop gracefully before forcibly terminating it with SIGKILL.
++- //
++- // - Use nil to use the default timeout (10 seconds).
++- // - Use '-1' to wait indefinitely.
++- // - Use '0' to not wait for the container to exit gracefully, and
++- // immediately proceeds to forcibly terminating the container.
++- // - Other positive values are used as timeout (in seconds).
++- Timeout *int `json:",omitempty"`
++-}
++-
++ // HealthConfig holds configuration settings for the HEALTHCHECK feature.
++ type HealthConfig struct {
++ // Test is the test to perform to check that the container is healthy.
++diff --git a/daemon/cluster/executor/backend.go b/daemon/cluster/executor/backend.go
++index d4a4bd318b..3c683cacba 100644
++--- a/daemon/cluster/executor/backend.go
+++++ b/daemon/cluster/executor/backend.go
++@@ -39,8 +39,8 @@ type Backend interface {
++ ReleaseIngress() (<-chan struct{}, error)
++ CreateManagedContainer(config types.ContainerCreateConfig) (container.CreateResponse, error)
++ ContainerStart(name string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error
++- ContainerStop(ctx context.Context, name string, config container.StopOptions) error
++- ContainerLogs(ctx context.Context, name string, config *types.ContainerLogsOptions) (msgs <-chan *backend.LogMessage, tty bool, err error)
+++ ContainerStop(name string, seconds *int) error
+++ ContainerLogs(context.Context, string, *types.ContainerLogsOptions) (msgs <-chan *backend.LogMessage, tty bool, err error)
++ ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error
++ ActivateContainerServiceBinding(containerName string) error
++ DeactivateContainerServiceBinding(containerName string) error
++diff --git a/daemon/cluster/executor/container/adapter.go b/daemon/cluster/executor/container/adapter.go
++index 48b339ba2f..160ba7dc8f 100644
++--- a/daemon/cluster/executor/container/adapter.go
+++++ b/daemon/cluster/executor/container/adapter.go
++@@ -412,13 +412,14 @@ func (c *containerAdapter) wait(ctx context.Context) (<-chan containerpkg.StateS
++ }
++
++ func (c *containerAdapter) shutdown(ctx context.Context) error {
++- var options = containertypes.StopOptions{}
++ // Default stop grace period to nil (daemon will use the stopTimeout of the container)
++- if spec := c.container.spec(); spec.StopGracePeriod != nil {
++- timeout := int(spec.StopGracePeriod.Seconds)
++- options.Timeout = &timeout
+++ var stopgrace *int
+++ spec := c.container.spec()
+++ if spec.StopGracePeriod != nil {
+++ stopgraceValue := int(spec.StopGracePeriod.Seconds)
+++ stopgrace = &stopgraceValue
++ }
++- return c.backend.ContainerStop(ctx, c.container.name(), options)
+++ return c.backend.ContainerStop(c.container.name(), stopgrace)
++ }
++
++ func (c *containerAdapter) terminate(ctx context.Context) error {
++diff --git a/daemon/daemon.go b/daemon/daemon.go
++index 272ab6bc5c..7fb6dc7a2e 100644
++--- a/daemon/daemon.go
+++++ b/daemon/daemon.go
++@@ -1148,7 +1148,7 @@ func (daemon *Daemon) waitForStartupDone() {
++
++ func (daemon *Daemon) shutdownContainer(c *container.Container) error {
++ // If container failed to exit in stopTimeout seconds of SIGTERM, then using the force
++- if err := daemon.containerStop(context.TODO(), c, containertypes.StopOptions{}); err != nil {
+++ if err := daemon.containerStop(c, nil); err != nil {
++ return fmt.Errorf("Failed to stop container %s with error: %v", c.ID, err)
++ }
++
++diff --git a/daemon/delete.go b/daemon/delete.go
++index e10c668352..94a82190b6 100644
++--- a/daemon/delete.go
+++++ b/daemon/delete.go
++@@ -1,7 +1,6 @@
++ package daemon // import "github.com/docker/docker/daemon"
++
++ import (
++- "context"
++ "fmt"
++ "os"
++ "path"
++@@ -9,7 +8,6 @@ import (
++ "time"
++
++ "github.com/docker/docker/api/types"
++- containertypes "github.com/docker/docker/api/types/container"
++ "github.com/docker/docker/container"
++ "github.com/docker/docker/errdefs"
++ "github.com/docker/docker/pkg/containerfs"
++@@ -111,7 +109,7 @@ func (daemon *Daemon) cleanupContainer(container *container.Container, config ty
++ // If you arrived here and know the answer, you earned yourself a picture
++ // of a cute animal of your own choosing.
++ var stopTimeout = 3
++- if err := daemon.containerStop(context.TODO(), container, containertypes.StopOptions{Timeout: &stopTimeout}); err != nil {
+++ if err := daemon.containerStop(container, &stopTimeout); err != nil {
++ return err
++ }
++
++diff --git a/daemon/restart.go b/daemon/restart.go
++index 2f69f0cc24..b5906a6a04 100644
++--- a/daemon/restart.go
+++++ b/daemon/restart.go
++@@ -1,7 +1,6 @@
++ package daemon // import "github.com/docker/docker/daemon"
++
++ import (
++- "context"
++ "fmt"
++
++ containertypes "github.com/docker/docker/api/types/container"
++@@ -14,12 +13,12 @@ import (
++ // timeout, ContainerRestart will wait forever until a graceful
++ // stop. Returns an error if the container cannot be found, or if
++ // there is an underlying error at any stage of the restart.
++-func (daemon *Daemon) ContainerRestart(ctx context.Context, name string, options containertypes.StopOptions) error {
+++func (daemon *Daemon) ContainerRestart(name string, seconds *int) error {
++ ctr, err := daemon.GetContainer(name)
++ if err != nil {
++ return err
++ }
++- err = daemon.containerRestart(ctx, ctr, options)
+++ err = daemon.containerRestart(ctr, seconds)
++ if err != nil {
++ return fmt.Errorf("Cannot restart container %s: %v", name, err)
++ }
++@@ -30,7 +29,7 @@ func (daemon *Daemon) ContainerRestart(ctx context.Context, name string, options
++ // container. When stopping, wait for the given duration in seconds to
++ // gracefully stop, before forcefully terminating the container. If
++ // given a negative duration, wait forever for a graceful stop.
++-func (daemon *Daemon) containerRestart(ctx context.Context, container *container.Container, options containertypes.StopOptions) error {
+++func (daemon *Daemon) containerRestart(container *container.Container, seconds *int) error {
++ // Determine isolation. If not specified in the hostconfig, use daemon default.
++ actualIsolation := container.HostConfig.Isolation
++ if containertypes.Isolation.IsDefault(actualIsolation) {
++@@ -54,7 +53,15 @@ func (daemon *Daemon) containerRestart(ctx context.Context, container *container
++ container.HasBeenManuallyRestarted = true
++ container.Unlock()
++
++- err := daemon.containerStop(ctx, container, options)
+++ container.HostConfig.AutoRemove = false
+++ err := daemon.containerStop(container, seconds)
+++ // restore AutoRemove irrespective of whether the stop worked or not
+++ container.HostConfig.AutoRemove = autoRemove
+++ // containerStop will write HostConfig to disk, we shall restore AutoRemove
+++ // in disk too
+++ if toDiskErr := daemon.checkpointAndSave(container); toDiskErr != nil {
+++ logrus.Errorf("Write container to disk error: %v", toDiskErr)
+++ }
++
++ if err != nil {
++ return err
++diff --git a/daemon/stop.go b/daemon/stop.go
++index 5a659c1cc8..9caf42cc95 100644
++--- a/daemon/stop.go
+++++ b/daemon/stop.go
++@@ -4,7 +4,6 @@ import (
++ "context"
++ "time"
++
++- containertypes "github.com/docker/docker/api/types/container"
++ "github.com/docker/docker/container"
++ "github.com/docker/docker/errdefs"
++ "github.com/moby/sys/signal"
++@@ -20,7 +19,7 @@ import (
++ // If the timeout is nil, the container's StopTimeout value is used, if set,
++ // otherwise the engine default. A negative timeout value can be specified,
++ // meaning no timeout, i.e. no forceful termination is performed.
++-func (daemon *Daemon) ContainerStop(ctx context.Context, name string, options containertypes.StopOptions) error {
+++func (daemon *Daemon) ContainerStop(name string, timeout *int) error {
++ ctr, err := daemon.GetContainer(name)
++ if err != nil {
++ return err
++@@ -28,7 +27,7 @@ func (daemon *Daemon) ContainerStop(ctx context.Context, name string, options co
++ if !ctr.IsRunning() {
++ return containerNotModifiedError{}
++ }
++- err = daemon.containerStop(ctx, ctr, options)
+++ err = daemon.containerStop(ctr, timeout)
++ if err != nil {
++ return errdefs.System(errors.Wrapf(err, "cannot stop container: %s", name))
++ }
++@@ -36,7 +35,9 @@ func (daemon *Daemon) ContainerStop(ctx context.Context, name string, options co
++ }
++
++ // containerStop sends a stop signal, waits, sends a kill signal.
++-func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Container, options containertypes.StopOptions) (retErr error) {
+++func (daemon *Daemon) containerStop(ctr *container.Container, seconds *int) (retErr error) {
+++ // TODO propagate a context down to this function
+++ ctx := context.TODO()
++ if !ctr.IsRunning() {
++ return nil
++ }
++@@ -45,15 +46,8 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
++ stopSignal = ctr.StopSignal()
++ stopTimeout = ctr.StopTimeout()
++ )
++- if options.Signal != "" {
++- sig, err := signal.ParseSignal(options.Signal)
++- if err != nil {
++- return errdefs.InvalidParameter(err)
++- }
++- stopSignal = sig
++- }
++- if options.Timeout != nil {
++- stopTimeout = *options.Timeout
+++ if seconds != nil {
+++ stopTimeout = *seconds
++ }
++
++ var wait time.Duration
++--
++2.37.3
++
+diff --git a/api/server/router/container/backend.go b/api/server/router/container/backend.go
+index 6145c51de1..395a70f22a 100644
+--- a/api/server/router/container/backend.go
++++ b/api/server/router/container/backend.go
+@@ -37,10 +37,10 @@ type stateBackend interface {
+ ContainerPause(name string) error
+ ContainerRename(oldName, newName string) error
+ ContainerResize(name string, height, width int) error
+- ContainerRestart(ctx context.Context, name string, options container.StopOptions) error
++ ContainerRestart(name string, seconds *int) error
+ ContainerRm(name string, config *types.ContainerRmConfig) error
+ ContainerStart(name string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error
+- ContainerStop(ctx context.Context, name string, options container.StopOptions) error
++ ContainerStop(name string, seconds *int) error
+ ContainerUnpause(name string) error
+ ContainerUpdate(name string, hostConfig *container.HostConfig) (container.ContainerUpdateOKBody, error)
+ ContainerWait(ctx context.Context, name string, condition containerpkg.WaitCondition) (<-chan containerpkg.StateStatus, error)
+diff --git a/api/server/router/container/container_routes.go b/api/server/router/container/container_routes.go
+index 057a7b0b52..6e4d422d54 100644
+--- a/api/server/router/container/container_routes.go
++++ b/api/server/router/container/container_routes.go
+@@ -227,22 +227,16 @@ func (s *containerRouter) postContainersStop(ctx context.Context, w http.Respons
+ return err
+ }
+
+- var (
+- options container.StopOptions
+- version = httputils.VersionFromContext(ctx)
+- )
+- if versions.GreaterThanOrEqualTo(version, "1.42") {
+- options.Signal = r.Form.Get("signal")
+- }
++ var seconds *int
+ if tmpSeconds := r.Form.Get("t"); tmpSeconds != "" {
+ valSeconds, err := strconv.Atoi(tmpSeconds)
+ if err != nil {
+ return err
+ }
+- options.Timeout = &valSeconds
++ seconds = &valSeconds
+ }
+
+- if err := s.backend.ContainerStop(ctx, vars["name"], options); err != nil {
++ if err := s.backend.ContainerStop(vars["name"], seconds); err != nil {
+ return err
+ }
+
+@@ -280,22 +274,16 @@ func (s *containerRouter) postContainersRestart(ctx context.Context, w http.Resp
+ return err
+ }
+
+- var (
+- options container.StopOptions
+- version = httputils.VersionFromContext(ctx)
+- )
+- if versions.GreaterThanOrEqualTo(version, "1.42") {
+- options.Signal = r.Form.Get("signal")
+- }
++ var seconds *int
+ if tmpSeconds := r.Form.Get("t"); tmpSeconds != "" {
+ valSeconds, err := strconv.Atoi(tmpSeconds)
+ if err != nil {
+ return err
+ }
+- options.Timeout = &valSeconds
++ seconds = &valSeconds
+ }
+
+- if err := s.backend.ContainerRestart(ctx, vars["name"], options); err != nil {
++ if err := s.backend.ContainerRestart(vars["name"], seconds); err != nil {
+ return err
+ }
+
+diff --git a/api/types/container/config.go b/api/types/container/config.go
+index b073e5dd36..f767195b94 100644
+--- a/api/types/container/config.go
++++ b/api/types/container/config.go
+@@ -13,24 +13,6 @@ import (
+ // Docker interprets it as 3 nanoseconds.
+ const MinimumDuration = 1 * time.Millisecond
+
+-// StopOptions holds the options to stop or restart a container.
+-type StopOptions struct {
+- // Signal (optional) is the signal to send to the container to (gracefully)
+- // stop it before forcibly terminating the container with SIGKILL after the
+- // timeout expires. If not value is set, the default (SIGTERM) is used.
+- Signal string `json:",omitempty"`
+-
+- // Timeout (optional) is the timeout (in seconds) to wait for the container
+- // to stop gracefully before forcibly terminating it with SIGKILL.
+- //
+- // - Use nil to use the default timeout (10 seconds).
+- // - Use '-1' to wait indefinitely.
+- // - Use '0' to not wait for the container to exit gracefully, and
+- // immediately proceeds to forcibly terminating the container.
+- // - Other positive values are used as timeout (in seconds).
+- Timeout *int `json:",omitempty"`
+-}
+-
+ // HealthConfig holds configuration settings for the HEALTHCHECK feature.
+ type HealthConfig struct {
+ // Test is the test to perform to check that the container is healthy.
+diff --git a/daemon/cluster/executor/backend.go b/daemon/cluster/executor/backend.go
+index 89b883ea2f..2187024af7 100644
+--- a/daemon/cluster/executor/backend.go
++++ b/daemon/cluster/executor/backend.go
+@@ -36,8 +36,8 @@ type Backend interface {
+ ReleaseIngress() (<-chan struct{}, error)
+ CreateManagedContainer(config types.ContainerCreateConfig) (container.CreateResponse, error)
+ ContainerStart(name string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error
+- ContainerStop(ctx context.Context, name string, config container.StopOptions) error
+- ContainerLogs(ctx context.Context, name string, config *types.ContainerLogsOptions) (msgs <-chan *backend.LogMessage, tty bool, err error)
++ ContainerStop(name string, seconds *int) error
++ ContainerLogs(context.Context, string, *types.ContainerLogsOptions) (msgs <-chan *backend.LogMessage, tty bool, err error)
+ ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error
+ ActivateContainerServiceBinding(containerName string) error
+ DeactivateContainerServiceBinding(containerName string) error
+diff --git a/daemon/cluster/executor/container/adapter.go b/daemon/cluster/executor/container/adapter.go
+index 4ed45526d2..82da8441d3 100644
+--- a/daemon/cluster/executor/container/adapter.go
++++ b/daemon/cluster/executor/container/adapter.go
+@@ -407,13 +407,14 @@ func (c *containerAdapter) wait(ctx context.Context) (<-chan containerpkg.StateS
+ }
+
+ func (c *containerAdapter) shutdown(ctx context.Context) error {
+- var options = containertypes.StopOptions{}
+ // Default stop grace period to nil (daemon will use the stopTimeout of the container)
+- if spec := c.container.spec(); spec.StopGracePeriod != nil {
+- timeout := int(spec.StopGracePeriod.Seconds)
+- options.Timeout = &timeout
++ var stopgrace *int
++ spec := c.container.spec()
++ if spec.StopGracePeriod != nil {
++ stopgraceValue := int(spec.StopGracePeriod.Seconds)
++ stopgrace = &stopgraceValue
+ }
+- return c.backend.ContainerStop(ctx, c.container.name(), options)
++ return c.backend.ContainerStop(c.container.name(), stopgrace)
+ }
+
+ func (c *containerAdapter) terminate(ctx context.Context) error {
+diff --git a/daemon/daemon.go b/daemon/daemon.go
+index bb09038b63..d6949b1f00 100644
+--- a/daemon/daemon.go
++++ b/daemon/daemon.go
+@@ -1136,7 +1136,7 @@ func (daemon *Daemon) waitForStartupDone() {
+
+ func (daemon *Daemon) shutdownContainer(c *container.Container) error {
+ // If container failed to exit in stopTimeout seconds of SIGTERM, then using the force
+- if err := daemon.containerStop(context.TODO(), c, containertypes.StopOptions{}); err != nil {
++ if err := daemon.containerStop(c, nil); err != nil {
+ return fmt.Errorf("Failed to stop container %s with error: %v", c.ID, err)
+ }
+
+diff --git a/daemon/delete.go b/daemon/delete.go
+index c2bbbd4196..05536a67d2 100644
+--- a/daemon/delete.go
++++ b/daemon/delete.go
+@@ -1,7 +1,6 @@
+ package daemon // import "github.com/docker/docker/daemon"
+
+ import (
+- "context"
+ "fmt"
+ "os"
+ "path"
+@@ -9,7 +8,6 @@ import (
+ "time"
+
+ "github.com/docker/docker/api/types"
+- containertypes "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/container"
+ "github.com/docker/docker/errdefs"
+ "github.com/docker/docker/pkg/containerfs"
+@@ -111,7 +109,7 @@ func (daemon *Daemon) cleanupContainer(container *container.Container, config ty
+ // If you arrived here and know the answer, you earned yourself a picture
+ // of a cute animal of your own choosing.
+ var stopTimeout = 3
+- if err := daemon.containerStop(context.TODO(), container, containertypes.StopOptions{Timeout: &stopTimeout}); err != nil {
++ if err := daemon.containerStop(container, &stopTimeout); err != nil {
+ return err
+ }
+
+diff --git a/daemon/restart.go b/daemon/restart.go
+index c20e8cbb10..5ac271c5e0 100644
+--- a/daemon/restart.go
++++ b/daemon/restart.go
+@@ -1,7 +1,6 @@
+ package daemon // import "github.com/docker/docker/daemon"
+
+ import (
+- "context"
+ "fmt"
+
+ containertypes "github.com/docker/docker/api/types/container"
+@@ -15,12 +14,12 @@ import (
+ // timeout, ContainerRestart will wait forever until a graceful
+ // stop. Returns an error if the container cannot be found, or if
+ // there is an underlying error at any stage of the restart.
+-func (daemon *Daemon) ContainerRestart(ctx context.Context, name string, options containertypes.StopOptions) error {
++func (daemon *Daemon) ContainerRestart(name string, seconds *int) error {
+ ctr, err := daemon.GetContainer(name)
+ if err != nil {
+ return err
+ }
+- err = daemon.containerRestart(ctx, ctr, options)
++ err = daemon.containerRestart(ctr, seconds)
+ if err != nil {
+ return fmt.Errorf("Cannot restart container %s: %v", name, err)
+ }
+@@ -32,7 +31,7 @@ func (daemon *Daemon) ContainerRestart(ctx context.Context, name string, options
+ // container. When stopping, wait for the given duration in seconds to
+ // gracefully stop, before forcefully terminating the container. If
+ // given a negative duration, wait forever for a graceful stop.
+-func (daemon *Daemon) containerRestart(ctx context.Context, container *container.Container, options containertypes.StopOptions) error {
++func (daemon *Daemon) containerRestart(container *container.Container, seconds *int) error {
+ // Determine isolation. If not specified in the hostconfig, use daemon default.
+ actualIsolation := container.HostConfig.Isolation
+ if containertypes.Isolation.IsDefault(actualIsolation) {
+@@ -57,7 +56,7 @@ func (daemon *Daemon) containerRestart(ctx context.Context, container *container
+ autoRemove := container.HostConfig.AutoRemove
+
+ container.HostConfig.AutoRemove = false
+- err := daemon.containerStop(ctx, container, options)
++ err := daemon.containerStop(container, seconds)
+ // restore AutoRemove irrespective of whether the stop worked or not
+ container.HostConfig.AutoRemove = autoRemove
+ // containerStop will write HostConfig to disk, we shall restore AutoRemove
+diff --git a/daemon/stop.go b/daemon/stop.go
+index 5a659c1cc8..9caf42cc95 100644
+--- a/daemon/stop.go
++++ b/daemon/stop.go
+@@ -4,7 +4,6 @@ import (
+ "context"
+ "time"
+
+- containertypes "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/container"
+ "github.com/docker/docker/errdefs"
+ "github.com/moby/sys/signal"
+@@ -20,7 +19,7 @@ import (
+ // If the timeout is nil, the container's StopTimeout value is used, if set,
+ // otherwise the engine default. A negative timeout value can be specified,
+ // meaning no timeout, i.e. no forceful termination is performed.
+-func (daemon *Daemon) ContainerStop(ctx context.Context, name string, options containertypes.StopOptions) error {
++func (daemon *Daemon) ContainerStop(name string, timeout *int) error {
+ ctr, err := daemon.GetContainer(name)
+ if err != nil {
+ return err
+@@ -28,7 +27,7 @@ func (daemon *Daemon) ContainerStop(ctx context.Context, name string, options co
+ if !ctr.IsRunning() {
+ return containerNotModifiedError{}
+ }
+- err = daemon.containerStop(ctx, ctr, options)
++ err = daemon.containerStop(ctr, timeout)
+ if err != nil {
+ return errdefs.System(errors.Wrapf(err, "cannot stop container: %s", name))
+ }
+@@ -36,7 +35,9 @@ func (daemon *Daemon) ContainerStop(ctx context.Context, name string, options co
+ }
+
+ // containerStop sends a stop signal, waits, sends a kill signal.
+-func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Container, options containertypes.StopOptions) (retErr error) {
++func (daemon *Daemon) containerStop(ctr *container.Container, seconds *int) (retErr error) {
++ // TODO propagate a context down to this function
++ ctx := context.TODO()
+ if !ctr.IsRunning() {
+ return nil
+ }
+@@ -45,15 +46,8 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
+ stopSignal = ctr.StopSignal()
+ stopTimeout = ctr.StopTimeout()
+ )
+- if options.Signal != "" {
+- sig, err := signal.ParseSignal(options.Signal)
+- if err != nil {
+- return errdefs.InvalidParameter(err)
+- }
+- stopSignal = sig
+- }
+- if options.Timeout != nil {
+- stopTimeout = *options.Timeout
++ if seconds != nil {
++ stopTimeout = *seconds
+ }
+
+ var wait time.Duration
+--
+2.37.3
+
diff --git a/0002-Revert-client-ContainerStop-ContainerRestart-support.patch b/0002-Revert-client-ContainerStop-ContainerRestart-support.patch
new file mode 100644
index 0000000..096e613
--- /dev/null
+++ b/0002-Revert-client-ContainerStop-ContainerRestart-support.patch
@@ -0,0 +1,412 @@
+From 8ed5b685f2f9dab63d50672eb20d66930c0dc096 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m(a)gmail.com>
+Date: Sun, 9 Oct 2022 15:09:05 +0200
+Subject: [PATCH 2/3] Revert "client: ContainerStop(), ContainerRestart():
+ support stop-signal"
+
+This reverts commit e8fa708ae5c460ebeec1a88a3ec3615272efaa4f.
+---
+ client/container_restart.go | 14 +++++---------
+ client/container_restart_test.go | 19 ++++++-------------
+ client/container_stop.go | 14 +++++---------
+ client/container_stop_test.go | 19 ++++++-------------
+ client/interface.go | 5 +++--
+ integration-cli/docker_api_containers_test.go | 18 +++++++-----------
+ integration/container/pause_test.go | 3 +--
+ integration/container/rename_test.go | 2 +-
+ integration/container/stop_linux_test.go | 4 ++--
+ integration/container/stop_test.go | 3 +--
+ integration/container/stop_windows_test.go | 4 ++--
+ integration/container/wait_test.go | 3 +--
+ 12 files changed, 40 insertions(+), 68 deletions(-)
+
+diff --git a/client/container_restart.go b/client/container_restart.go
+index 1e0ad99981..aa0d6485de 100644
+--- a/client/container_restart.go
++++ b/client/container_restart.go
+@@ -3,22 +3,18 @@ package client // import "github.com/docker/docker/client"
+ import (
+ "context"
+ "net/url"
+- "strconv"
++ "time"
+
+- "github.com/docker/docker/api/types/container"
+- "github.com/docker/docker/api/types/versions"
++ timetypes "github.com/docker/docker/api/types/time"
+ )
+
+ // ContainerRestart stops and starts a container again.
+ // It makes the daemon wait for the container to be up again for
+ // a specific amount of time, given the timeout.
+-func (cli *Client) ContainerRestart(ctx context.Context, containerID string, options container.StopOptions) error {
++func (cli *Client) ContainerRestart(ctx context.Context, containerID string, timeout *time.Duration) error {
+ query := url.Values{}
+- if options.Timeout != nil {
+- query.Set("t", strconv.Itoa(*options.Timeout))
+- }
+- if options.Signal != "" && versions.GreaterThanOrEqualTo(cli.version, "1.42") {
+- query.Set("signal", options.Signal)
++ if timeout != nil {
++ query.Set("t", timetypes.DurationToSecondsString(*timeout))
+ }
+ resp, err := cli.post(ctx, "/containers/"+containerID+"/restart", query, nil, nil)
+ ensureReaderClosed(resp)
+diff --git a/client/container_restart_test.go b/client/container_restart_test.go
+index 8c66525edb..085da26b70 100644
+--- a/client/container_restart_test.go
++++ b/client/container_restart_test.go
+@@ -8,8 +8,8 @@ import (
+ "net/http"
+ "strings"
+ "testing"
++ "time"
+
+- "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/errdefs"
+ )
+
+@@ -17,23 +17,20 @@ func TestContainerRestartError(t *testing.T) {
+ client := &Client{
+ client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
+ }
+- err := client.ContainerRestart(context.Background(), "nothing", container.StopOptions{})
++ timeout := 0 * time.Second
++ err := client.ContainerRestart(context.Background(), "nothing", &timeout)
+ if !errdefs.IsSystem(err) {
+ t.Fatalf("expected a Server Error, got %[1]T: %[1]v", err)
+ }
+ }
+
+ func TestContainerRestart(t *testing.T) {
+- const expectedURL = "/v1.42/containers/container_id/restart"
++ expectedURL := "/containers/container_id/restart"
+ client := &Client{
+ client: newMockClient(func(req *http.Request) (*http.Response, error) {
+ if !strings.HasPrefix(req.URL.Path, expectedURL) {
+ return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL)
+ }
+- s := req.URL.Query().Get("signal")
+- if s != "SIGKILL" {
+- return nil, fmt.Errorf("signal not set in URL query. Expected 'SIGKILL', got '%s'", s)
+- }
+ t := req.URL.Query().Get("t")
+ if t != "100" {
+ return nil, fmt.Errorf("t (timeout) not set in URL query properly. Expected '100', got %s", t)
+@@ -43,13 +40,9 @@ func TestContainerRestart(t *testing.T) {
+ Body: io.NopCloser(bytes.NewReader([]byte(""))),
+ }, nil
+ }),
+- version: "1.42",
+ }
+- timeout := 100
+- err := client.ContainerRestart(context.Background(), "container_id", container.StopOptions{
+- Signal: "SIGKILL",
+- Timeout: &timeout,
+- })
++ timeout := 100 * time.Second
++ err := client.ContainerRestart(context.Background(), "container_id", &timeout)
+ if err != nil {
+ t.Fatal(err)
+ }
+diff --git a/client/container_stop.go b/client/container_stop.go
+index 2a43ce2274..629d7ab64c 100644
+--- a/client/container_stop.go
++++ b/client/container_stop.go
+@@ -3,10 +3,9 @@ package client // import "github.com/docker/docker/client"
+ import (
+ "context"
+ "net/url"
+- "strconv"
++ "time"
+
+- "github.com/docker/docker/api/types/container"
+- "github.com/docker/docker/api/types/versions"
++ timetypes "github.com/docker/docker/api/types/time"
+ )
+
+ // ContainerStop stops a container. In case the container fails to stop
+@@ -16,13 +15,10 @@ import (
+ // If the timeout is nil, the container's StopTimeout value is used, if set,
+ // otherwise the engine default. A negative timeout value can be specified,
+ // meaning no timeout, i.e. no forceful termination is performed.
+-func (cli *Client) ContainerStop(ctx context.Context, containerID string, options container.StopOptions) error {
++func (cli *Client) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error {
+ query := url.Values{}
+- if options.Timeout != nil {
+- query.Set("t", strconv.Itoa(*options.Timeout))
+- }
+- if options.Signal != "" && versions.GreaterThanOrEqualTo(cli.version, "1.42") {
+- query.Set("signal", options.Signal)
++ if timeout != nil {
++ query.Set("t", timetypes.DurationToSecondsString(*timeout))
+ }
+ resp, err := cli.post(ctx, "/containers/"+containerID+"/stop", query, nil, nil)
+ ensureReaderClosed(resp)
+diff --git a/client/container_stop_test.go b/client/container_stop_test.go
+index ec4cfc0d3c..f5df1805cb 100644
+--- a/client/container_stop_test.go
++++ b/client/container_stop_test.go
+@@ -8,8 +8,8 @@ import (
+ "net/http"
+ "strings"
+ "testing"
++ "time"
+
+- "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/errdefs"
+ )
+
+@@ -17,23 +17,20 @@ func TestContainerStopError(t *testing.T) {
+ client := &Client{
+ client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
+ }
+- err := client.ContainerStop(context.Background(), "nothing", container.StopOptions{})
++ timeout := 0 * time.Second
++ err := client.ContainerStop(context.Background(), "nothing", &timeout)
+ if !errdefs.IsSystem(err) {
+ t.Fatalf("expected a Server Error, got %[1]T: %[1]v", err)
+ }
+ }
+
+ func TestContainerStop(t *testing.T) {
+- const expectedURL = "/v1.42/containers/container_id/stop"
++ expectedURL := "/containers/container_id/stop"
+ client := &Client{
+ client: newMockClient(func(req *http.Request) (*http.Response, error) {
+ if !strings.HasPrefix(req.URL.Path, expectedURL) {
+ return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL)
+ }
+- s := req.URL.Query().Get("signal")
+- if s != "SIGKILL" {
+- return nil, fmt.Errorf("signal not set in URL query. Expected 'SIGKILL', got '%s'", s)
+- }
+ t := req.URL.Query().Get("t")
+ if t != "100" {
+ return nil, fmt.Errorf("t (timeout) not set in URL query properly. Expected '100', got %s", t)
+@@ -43,13 +40,9 @@ func TestContainerStop(t *testing.T) {
+ Body: io.NopCloser(bytes.NewReader([]byte(""))),
+ }, nil
+ }),
+- version: "1.42",
+ }
+- timeout := 100
+- err := client.ContainerStop(context.Background(), "container_id", container.StopOptions{
+- Signal: "SIGKILL",
+- Timeout: &timeout,
+- })
++ timeout := 100 * time.Second
++ err := client.ContainerStop(context.Background(), "container_id", &timeout)
+ if err != nil {
+ t.Fatal(err)
+ }
+diff --git a/client/interface.go b/client/interface.go
+index e9c1ed722e..73934b2361 100644
+--- a/client/interface.go
++++ b/client/interface.go
+@@ -5,6 +5,7 @@ import (
+ "io"
+ "net"
+ "net/http"
++ "time"
+
+ "github.com/docker/docker/api/types"
+ "github.com/docker/docker/api/types/container"
+@@ -64,12 +65,12 @@ type ContainerAPIClient interface {
+ ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error
+ ContainerRename(ctx context.Context, container, newContainerName string) error
+ ContainerResize(ctx context.Context, container string, options types.ResizeOptions) error
+- ContainerRestart(ctx context.Context, container string, options container.StopOptions) error
++ ContainerRestart(ctx context.Context, container string, timeout *time.Duration) error
+ ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error)
+ ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error)
+ ContainerStatsOneShot(ctx context.Context, container string) (types.ContainerStats, error)
+ ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error
+- ContainerStop(ctx context.Context, container string, options container.StopOptions) error
++ ContainerStop(ctx context.Context, container string, timeout *time.Duration) error
+ ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error)
+ ContainerUnpause(ctx context.Context, container string) error
+ ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error)
+diff --git a/integration-cli/docker_api_containers_test.go b/integration-cli/docker_api_containers_test.go
+index b5e6b18e67..e58814f540 100644
+--- a/integration-cli/docker_api_containers_test.go
++++ b/integration-cli/docker_api_containers_test.go
+@@ -913,8 +913,8 @@ func (s *DockerSuite) TestContainerAPIRestart(c *testing.T) {
+ assert.NilError(c, err)
+ defer cli.Close()
+
+- timeout := 1
+- err = cli.ContainerRestart(context.Background(), name, container.StopOptions{Timeout: &timeout})
++ timeout := 1 * time.Second
++ err = cli.ContainerRestart(context.Background(), name, &timeout)
+ assert.NilError(c, err)
+
+ assert.Assert(c, waitInspect(name, "{{ .State.Restarting }} {{ .State.Running }}", "false true", 15*time.Second) == nil)
+@@ -930,7 +930,7 @@ func (s *DockerSuite) TestContainerAPIRestartNotimeoutParam(c *testing.T) {
+ assert.NilError(c, err)
+ defer cli.Close()
+
+- err = cli.ContainerRestart(context.Background(), name, container.StopOptions{})
++ err = cli.ContainerRestart(context.Background(), name, nil)
+ assert.NilError(c, err)
+
+ assert.Assert(c, waitInspect(name, "{{ .State.Restarting }} {{ .State.Running }}", "false true", 15*time.Second) == nil)
+@@ -965,23 +965,19 @@ func (s *DockerSuite) TestContainerAPIStart(c *testing.T) {
+ func (s *DockerSuite) TestContainerAPIStop(c *testing.T) {
+ name := "test-api-stop"
+ runSleepingContainer(c, "-i", "--name", name)
+- timeout := 30
++ timeout := 30 * time.Second
+
+ cli, err := client.NewClientWithOpts(client.FromEnv)
+ assert.NilError(c, err)
+ defer cli.Close()
+
+- err = cli.ContainerStop(context.Background(), name, container.StopOptions{
+- Timeout: &timeout,
+- })
++ err = cli.ContainerStop(context.Background(), name, &timeout)
+ assert.NilError(c, err)
+ assert.Assert(c, waitInspect(name, "{{ .State.Running }}", "false", 60*time.Second) == nil)
+
+ // second call to start should give 304
+ // maybe add ContainerStartWithRaw to test it
+- err = cli.ContainerStop(context.Background(), name, container.StopOptions{
+- Timeout: &timeout,
+- })
++ err = cli.ContainerStop(context.Background(), name, &timeout)
+ assert.NilError(c, err)
+ }
+
+@@ -1259,7 +1255,7 @@ func (s *DockerSuite) TestContainerAPIPostContainerStop(c *testing.T) {
+ assert.NilError(c, err)
+ defer cli.Close()
+
+- err = cli.ContainerStop(context.Background(), containerID, container.StopOptions{})
++ err = cli.ContainerStop(context.Background(), containerID, nil)
+ assert.NilError(c, err)
+ assert.Assert(c, waitInspect(containerID, "{{ .State.Running }}", "false", 60*time.Second) == nil)
+ }
+diff --git a/integration/container/pause_test.go b/integration/container/pause_test.go
+index e34eeee337..63e7fe3a6e 100644
+--- a/integration/container/pause_test.go
++++ b/integration/container/pause_test.go
+@@ -8,7 +8,6 @@ import (
+
+ containerderrdefs "github.com/containerd/containerd/errdefs"
+ "github.com/docker/docker/api/types"
+- containertypes "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/api/types/events"
+ "github.com/docker/docker/api/types/filters"
+ "github.com/docker/docker/api/types/versions"
+@@ -81,7 +80,7 @@ func TestPauseStopPausedContainer(t *testing.T) {
+ err := client.ContainerPause(ctx, cID)
+ assert.NilError(t, err)
+
+- err = client.ContainerStop(ctx, cID, containertypes.StopOptions{})
++ err = client.ContainerStop(ctx, cID, nil)
+ assert.NilError(t, err)
+
+ poll.WaitOn(t, container.IsStopped(ctx, client, cID), poll.WithDelay(100*time.Millisecond))
+diff --git a/integration/container/rename_test.go b/integration/container/rename_test.go
+index 689a37fc32..b2ad4902ec 100644
+--- a/integration/container/rename_test.go
++++ b/integration/container/rename_test.go
+@@ -143,7 +143,7 @@ func TestRenameAnonymousContainer(t *testing.T) {
+ assert.NilError(t, err)
+ // Stop/Start the container to get registered
+ // FIXME(vdemeester) this is a really weird behavior as it fails otherwise
+- err = client.ContainerStop(ctx, container1Name, containertypes.StopOptions{})
++ err = client.ContainerStop(ctx, container1Name, nil)
+ assert.NilError(t, err)
+ err = client.ContainerStart(ctx, container1Name, types.ContainerStartOptions{})
+ assert.NilError(t, err)
+diff --git a/integration/container/stop_linux_test.go b/integration/container/stop_linux_test.go
+index 0535ce7787..9ce11f37d1 100644
+--- a/integration/container/stop_linux_test.go
++++ b/integration/container/stop_linux_test.go
+@@ -9,7 +9,6 @@ import (
+ "time"
+
+ "github.com/docker/docker/api/types"
+- containertypes "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/integration/internal/container"
+ "gotest.tools/v3/assert"
+ "gotest.tools/v3/icmd"
+@@ -57,7 +56,8 @@ func TestStopContainerWithTimeout(t *testing.T) {
+ t.Parallel()
+ id := container.Run(ctx, t, client, testCmd)
+
+- err := client.ContainerStop(ctx, id, containertypes.StopOptions{Timeout: &d.timeout})
++ timeout := time.Duration(d.timeout) * time.Second
++ err := client.ContainerStop(ctx, id, &timeout)
+ assert.NilError(t, err)
+
+ poll.WaitOn(t, container.IsStopped(ctx, client, id),
+diff --git a/integration/container/stop_test.go b/integration/container/stop_test.go
+index b026527e88..7e12996e33 100644
+--- a/integration/container/stop_test.go
++++ b/integration/container/stop_test.go
+@@ -5,7 +5,6 @@ import (
+ "testing"
+ "time"
+
+- containertypes "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/integration/internal/container"
+ "gotest.tools/v3/assert"
+ "gotest.tools/v3/poll"
+@@ -30,7 +29,7 @@ func TestStopContainerWithRestartPolicyAlways(t *testing.T) {
+ }
+
+ for _, name := range names {
+- err := client.ContainerStop(ctx, name, containertypes.StopOptions{})
++ err := client.ContainerStop(ctx, name, nil)
+ assert.NilError(t, err)
+ }
+
+diff --git a/integration/container/stop_windows_test.go b/integration/container/stop_windows_test.go
+index 65683822e9..a20ba5e6d9 100644
+--- a/integration/container/stop_windows_test.go
++++ b/integration/container/stop_windows_test.go
+@@ -6,7 +6,6 @@ import (
+ "testing"
+ "time"
+
+- containertypes "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/integration/internal/container"
+ "gotest.tools/v3/assert"
+ "gotest.tools/v3/poll"
+@@ -54,7 +53,8 @@ func TestStopContainerWithTimeout(t *testing.T) {
+ t.Parallel()
+ id := container.Run(ctx, t, client, testCmd)
+
+- err := client.ContainerStop(ctx, id, containertypes.StopOptions{Timeout: &d.timeout})
++ timeout := time.Duration(d.timeout) * time.Second
++ err := client.ContainerStop(ctx, id, &timeout)
+ assert.NilError(t, err)
+
+ poll.WaitOn(t, container.IsStopped(ctx, client, id),
+diff --git a/integration/container/wait_test.go b/integration/container/wait_test.go
+index 990868fd35..44e2c81143 100644
+--- a/integration/container/wait_test.go
++++ b/integration/container/wait_test.go
+@@ -5,7 +5,6 @@ import (
+ "testing"
+ "time"
+
+- containertypes "github.com/docker/docker/api/types/container"
+ "github.com/docker/docker/integration/internal/container"
+ "github.com/docker/docker/testutil/request"
+ "gotest.tools/v3/assert"
+@@ -87,7 +86,7 @@ func TestWaitBlocked(t *testing.T) {
+
+ waitResC, errC := cli.ContainerWait(ctx, containerID, "")
+
+- err := cli.ContainerStop(ctx, containerID, containertypes.StopOptions{})
++ err := cli.ContainerStop(ctx, containerID, nil)
+ assert.NilError(t, err)
+
+ select {
+--
+2.37.3
+
diff --git a/0003-Revert-api-types-time-remove-DurationToSecondsString.patch b/0003-Revert-api-types-time-remove-DurationToSecondsString.patch
new file mode 100644
index 0000000..4b42f3d
--- /dev/null
+++ b/0003-Revert-api-types-time-remove-DurationToSecondsString.patch
@@ -0,0 +1,67 @@
+From 2a7a57fec84b54c23fbbdc841d416c8a3174b4d5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m(a)gmail.com>
+Date: Sun, 9 Oct 2022 16:37:29 +0200
+Subject: [PATCH 3/3] Revert "api/types/time: remove DurationToSecondsString()
+ utility as it's no longer used"
+
+This reverts commit 90647e22b2a9c2ebb3e0c8744cddb913aefe4a0d.
+---
+ api/types/time/duration_convert.go | 12 ++++++++++++
+ api/types/time/duration_convert_test.go | 26 +++++++++++++++++++++++++
+ 2 files changed, 38 insertions(+)
+ create mode 100644 api/types/time/duration_convert.go
+ create mode 100644 api/types/time/duration_convert_test.go
+
+diff --git a/api/types/time/duration_convert.go b/api/types/time/duration_convert.go
+new file mode 100644
+index 0000000000..84b6f07322
+--- /dev/null
++++ b/api/types/time/duration_convert.go
+@@ -0,0 +1,12 @@
++package time // import "github.com/docker/docker/api/types/time"
++
++import (
++ "strconv"
++ "time"
++)
++
++// DurationToSecondsString converts the specified duration to the number
++// seconds it represents, formatted as a string.
++func DurationToSecondsString(duration time.Duration) string {
++ return strconv.FormatFloat(duration.Seconds(), 'f', 0, 64)
++}
+diff --git a/api/types/time/duration_convert_test.go b/api/types/time/duration_convert_test.go
+new file mode 100644
+index 0000000000..a23be94776
+--- /dev/null
++++ b/api/types/time/duration_convert_test.go
+@@ -0,0 +1,26 @@
++package time // import "github.com/docker/docker/api/types/time"
++
++import (
++ "testing"
++ "time"
++)
++
++func TestDurationToSecondsString(t *testing.T) {
++ cases := []struct {
++ in time.Duration
++ expected string
++ }{
++ {0 * time.Second, "0"},
++ {1 * time.Second, "1"},
++ {1 * time.Minute, "60"},
++ {24 * time.Hour, "86400"},
++ }
++
++ for _, c := range cases {
++ s := DurationToSecondsString(c.in)
++ if s != c.expected {
++ t.Errorf("wrong value for input `%v`: expected `%s`, got `%s`", c.in, c.expected, s)
++ t.Fail()
++ }
++ }
++}
+--
+2.37.3
+
diff --git a/golang-github-docker.spec b/golang-github-docker.spec
index 01f3e02..cb6c3e3 100644
--- a/golang-github-docker.spec
+++ b/golang-github-docker.spec
@@ -1,20 +1,21 @@
-# Generated by go2rpm
+# Generated by go2rpm 1.6.0
%bcond_without check
-%bcond_with bootstrap
-%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options\\)$
+%bcond_without bootstrap
+%global debug_package %{nil}
%if %{with bootstrap}
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$
%endif
-# https://github.com/docker/docker
+# https://github.com/moby/moby
%global goipath github.com/docker/docker
%global forgeurl https://github.com/moby/moby
-Version: 20.10.12
+Version: 22.06.0~beta.0
+%global tag v22.06.0-beta.0
%gometa
-%global goaltipaths github.com/moby/moby
+%global goaltipaths github.com/moby/moby
%global common_description %{expand:
Moby is an open-source project created by Docker to enable and accelerate
@@ -29,256 +30,34 @@ other tools and projects.}
%global golicenses LICENSE NOTICE
%global godocs docs AUTHORS CHANGELOG.md CONTRIBUTING.md README.md\\\
- ROADMAP.md TESTING.md VENDORING.md
-
-%if %{with bootstrap}
-%global gosupfiles ${vendor[@]}
-%endif
+ ROADMAP.md SECURITY.md TESTING.md VENDORING.md
Name: %{goname}
Release: %autorelease
Summary: Collaborative project for the container ecosystem
-# Upstream license specification: Apache-2.0
-License: ASL 2.0
+# Upstream license specification: MIT and Apache-2.0
+License: MIT AND Apache-2.0
URL: %{gourl}
Source0: %{gosource}
+# For compatibility with current Swarmkit
+# https://github.com/moby/swarmkit/issues/3081
+Patch0: 0001-Revert-backend-add-StopOptions-to-ContainerRestart-a.patch
+Patch1: 0002-Revert-client-ContainerStop-ContainerRestart-support.patch
+Patch2: 0003-Revert-api-types-time-remove-DurationToSecondsString.patch
-%if %{without bootstrap}
-BuildRequires: golang(cloud.google.com/go/compute/metadata)
-BuildRequires: golang(cloud.google.com/go/logging)
-BuildRequires: golang(github.com/aws/aws-sdk-go/aws)
-BuildRequires: golang(github.com/aws/aws-sdk-go/aws/awserr)
-BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials/endpointcreds)
-BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
-BuildRequires: golang(github.com/aws/aws-sdk-go/aws/request)
-BuildRequires: golang(github.com/aws/aws-sdk-go/aws/session)
-BuildRequires: golang(github.com/aws/aws-sdk-go/service/cloudwatchlogs)
-BuildRequires: golang(github.com/bsphere/le_go)
-BuildRequires: golang(github.com/BurntSushi/toml)
-BuildRequires: golang(github.com/containerd/cgroups)
-BuildRequires: golang(github.com/containerd/cgroups/stats/v1)
-BuildRequires: golang(github.com/containerd/cgroups/v2)
-BuildRequires: golang(github.com/containerd/cgroups/v2/stats)
-BuildRequires: golang(github.com/containerd/containerd)
-BuildRequires: golang(github.com/containerd/containerd/api/events)
-BuildRequires: golang(github.com/containerd/containerd/api/types)
-BuildRequires: golang(github.com/containerd/containerd/archive)
-BuildRequires: golang(github.com/containerd/containerd/cio)
-BuildRequires: golang(github.com/containerd/containerd/containers)
-BuildRequires: golang(github.com/containerd/containerd/content)
-BuildRequires: golang(github.com/containerd/containerd/content/local)
-BuildRequires: golang(github.com/containerd/containerd/contrib/nvidia)
-BuildRequires: golang(github.com/containerd/containerd/defaults)
-BuildRequires: golang(github.com/containerd/containerd/errdefs)
-BuildRequires: golang(github.com/containerd/containerd/events)
-BuildRequires: golang(github.com/containerd/containerd/gc)
-BuildRequires: golang(github.com/containerd/containerd/images)
-BuildRequires: golang(github.com/containerd/containerd/leases)
-BuildRequires: golang(github.com/containerd/containerd/log)
-BuildRequires: golang(github.com/containerd/containerd/metadata)
-BuildRequires: golang(github.com/containerd/containerd/mount)
-BuildRequires: golang(github.com/containerd/containerd/namespaces)
-BuildRequires: golang(github.com/containerd/containerd/oci)
-BuildRequires: golang(github.com/containerd/containerd/pkg/dialer)
-BuildRequires: golang(github.com/containerd/containerd/platforms)
-BuildRequires: golang(github.com/containerd/containerd/reference)
-BuildRequires: golang(github.com/containerd/containerd/remotes)
-BuildRequires: golang(github.com/containerd/containerd/remotes/docker)
-BuildRequires: golang(github.com/containerd/containerd/remotes/docker/schema1)
-BuildRequires: golang(github.com/containerd/containerd/rootfs)
-BuildRequires: golang(github.com/containerd/containerd/runtime/linux/runctypes)
-BuildRequires: golang(github.com/containerd/containerd/runtime/v1/linux)
-BuildRequires: golang(github.com/containerd/containerd/runtime/v2/runc/options)
-BuildRequires: golang(github.com/containerd/containerd/services/server/config)
-BuildRequires: golang(github.com/containerd/containerd/snapshots)
-BuildRequires: golang(github.com/containerd/containerd/sys)
-BuildRequires: golang(github.com/containerd/continuity/driver)
-BuildRequires: golang(github.com/containerd/continuity/fs)
-BuildRequires: golang(github.com/containerd/continuity/pathdriver)
-BuildRequires: golang(github.com/containerd/fifo)
-BuildRequires: golang(github.com/containerd/typeurl)
-BuildRequires: golang(github.com/coreos/go-systemd/v22/activation)
-BuildRequires: golang(github.com/coreos/go-systemd/v22/daemon)
-BuildRequires: golang(github.com/coreos/go-systemd/v22/journal)
-BuildRequires: golang(github.com/docker/distribution)
-BuildRequires: golang(github.com/docker/distribution/digestset)
-BuildRequires: golang(github.com/docker/distribution/manifest/manifestlist)
-BuildRequires: golang(github.com/docker/distribution/manifest/ocischema)
-BuildRequires: golang(github.com/docker/distribution/manifest/schema1)
-BuildRequires: golang(github.com/docker/distribution/manifest/schema2)
-BuildRequires: golang(github.com/docker/distribution/reference)
-BuildRequires: golang(github.com/docker/distribution/registry/api/errcode)
-BuildRequires: golang(github.com/docker/distribution/registry/api/v2)
-BuildRequires: golang(github.com/docker/distribution/registry/client)
-BuildRequires: golang(github.com/docker/distribution/registry/client/auth)
-BuildRequires: golang(github.com/docker/distribution/registry/client/auth/challenge)
-BuildRequires: golang(github.com/docker/distribution/registry/client/transport)
-BuildRequires: golang(github.com/docker/go-connections/nat)
-BuildRequires: golang(github.com/docker/go-connections/sockets)
-BuildRequires: golang(github.com/docker/go-connections/tlsconfig)
-BuildRequires: golang(github.com/docker/go-metrics)
-BuildRequires: golang(github.com/docker/go-units)
-BuildRequires: golang(github.com/docker/libkv)
-BuildRequires: golang(github.com/docker/libkv/store)
-BuildRequires: golang(github.com/docker/libkv/store/consul)
-BuildRequires: golang(github.com/docker/libkv/store/etcd)
-BuildRequires: golang(github.com/docker/libkv/store/zookeeper)
-BuildRequires: golang(github.com/docker/libnetwork)
-BuildRequires: golang(github.com/docker/libnetwork/cluster)
-BuildRequires: golang(github.com/docker/libnetwork/config)
-BuildRequires: golang(github.com/docker/libnetwork/datastore)
-BuildRequires: golang(github.com/docker/libnetwork/driverapi)
-BuildRequires: golang(github.com/docker/libnetwork/drivers/bridge)
-BuildRequires: golang(github.com/docker/libnetwork/ipamapi)
-BuildRequires: golang(github.com/docker/libnetwork/ipamutils)
-BuildRequires: golang(github.com/docker/libnetwork/netlabel)
-BuildRequires: golang(github.com/docker/libnetwork/netutils)
-BuildRequires: golang(github.com/docker/libnetwork/networkdb)
-BuildRequires: golang(github.com/docker/libnetwork/options)
-BuildRequires: golang(github.com/docker/libnetwork/portallocator)
-BuildRequires: golang(github.com/docker/libnetwork/resolvconf)
-BuildRequires: golang(github.com/docker/libnetwork/types)
-BuildRequires: golang(github.com/docker/libtrust)
-BuildRequires: golang(github.com/docker/swarmkit/agent)
-BuildRequires: golang(github.com/docker/swarmkit/agent/exec)
-BuildRequires: golang(github.com/docker/swarmkit/api)
-BuildRequires: golang(github.com/docker/swarmkit/api/genericresource)
-BuildRequires: golang(github.com/docker/swarmkit/api/naming)
-BuildRequires: golang(github.com/docker/swarmkit/ca)
-BuildRequires: golang(github.com/docker/swarmkit/log)
-BuildRequires: golang(github.com/docker/swarmkit/manager/allocator/cnmallocator)
-BuildRequires: golang(github.com/docker/swarmkit/manager/encryption)
-BuildRequires: golang(github.com/docker/swarmkit/node)
-BuildRequires: golang(github.com/docker/swarmkit/template)
-BuildRequires: golang(github.com/fluent/fluent-logger-golang/fluent)
-BuildRequires: golang(github.com/fsnotify/fsnotify)
-BuildRequires: golang(github.com/gogo/protobuf/proto)
-BuildRequires: golang(github.com/gogo/protobuf/sortkeys)
-BuildRequires: golang(github.com/gogo/protobuf/types)
-BuildRequires: golang(github.com/golang/gddo/httputil)
-BuildRequires: golang(github.com/google/uuid)
-BuildRequires: golang(github.com/gorilla/mux)
-BuildRequires: golang(github.com/Graylog2/go-gelf/gelf)
-BuildRequires: golang(github.com/hashicorp/go-immutable-radix)
-BuildRequires: golang(github.com/hashicorp/go-memdb)
-BuildRequires: golang(github.com/imdario/mergo)
-BuildRequires: golang(github.com/mistifyio/go-zfs)
-BuildRequires: golang(github.com/moby/buildkit/api/services/control)
-BuildRequires: golang(github.com/moby/buildkit/cache)
-BuildRequires: golang(github.com/moby/buildkit/cache/metadata)
-BuildRequires: golang(github.com/moby/buildkit/cache/remotecache)
-BuildRequires: golang(github.com/moby/buildkit/cache/remotecache/inline)
-BuildRequires: golang(github.com/moby/buildkit/cache/remotecache/local)
-BuildRequires: golang(github.com/moby/buildkit/cache/remotecache/registry)
-BuildRequires: golang(github.com/moby/buildkit/cache/remotecache/v1)
-BuildRequires: golang(github.com/moby/buildkit/client)
-BuildRequires: golang(github.com/moby/buildkit/client/llb)
-BuildRequires: golang(github.com/moby/buildkit/cmd/buildkitd/config)
-BuildRequires: golang(github.com/moby/buildkit/control)
-BuildRequires: golang(github.com/moby/buildkit/executor)
-BuildRequires: golang(github.com/moby/buildkit/executor/oci)
-BuildRequires: golang(github.com/moby/buildkit/executor/runcexecutor)
-BuildRequires: golang(github.com/moby/buildkit/exporter)
-BuildRequires: golang(github.com/moby/buildkit/exporter/containerimage/exptypes)
-BuildRequires: golang(github.com/moby/buildkit/exporter/local)
-BuildRequires: golang(github.com/moby/buildkit/exporter/tar)
-BuildRequires: golang(github.com/moby/buildkit/frontend)
-BuildRequires: golang(github.com/moby/buildkit/frontend/dockerfile/builder)
-BuildRequires: golang(github.com/moby/buildkit/frontend/dockerfile/dockerignore)
-BuildRequires: golang(github.com/moby/buildkit/frontend/dockerfile/instructions)
-BuildRequires: golang(github.com/moby/buildkit/frontend/dockerfile/parser)
-BuildRequires: golang(github.com/moby/buildkit/frontend/dockerfile/shell)
-BuildRequires: golang(github.com/moby/buildkit/frontend/gateway)
-BuildRequires: golang(github.com/moby/buildkit/frontend/gateway/forwarder)
-BuildRequires: golang(github.com/moby/buildkit/identity)
-BuildRequires: golang(github.com/moby/buildkit/session)
-BuildRequires: golang(github.com/moby/buildkit/snapshot)
-BuildRequires: golang(github.com/moby/buildkit/snapshot/containerd)
-BuildRequires: golang(github.com/moby/buildkit/solver)
-BuildRequires: golang(github.com/moby/buildkit/solver/bboltcachestorage)
-BuildRequires: golang(github.com/moby/buildkit/solver/llbsolver/mounts)
-BuildRequires: golang(github.com/moby/buildkit/solver/llbsolver/ops)
-BuildRequires: golang(github.com/moby/buildkit/solver/pb)
-BuildRequires: golang(github.com/moby/buildkit/source)
-BuildRequires: golang(github.com/moby/buildkit/source/git)
-BuildRequires: golang(github.com/moby/buildkit/source/http)
-BuildRequires: golang(github.com/moby/buildkit/source/local)
-BuildRequires: golang(github.com/moby/buildkit/util/apicaps)
-BuildRequires: golang(github.com/moby/buildkit/util/archutil)
-BuildRequires: golang(github.com/moby/buildkit/util/compression)
-BuildRequires: golang(github.com/moby/buildkit/util/contentutil)
-BuildRequires: golang(github.com/moby/buildkit/util/entitlements)
-BuildRequires: golang(github.com/moby/buildkit/util/flightcontrol)
-BuildRequires: golang(github.com/moby/buildkit/util/imageutil)
-BuildRequires: golang(github.com/moby/buildkit/util/leaseutil)
-BuildRequires: golang(github.com/moby/buildkit/util/network)
-BuildRequires: golang(github.com/moby/buildkit/util/progress)
-BuildRequires: golang(github.com/moby/buildkit/util/resolver)
-BuildRequires: golang(github.com/moby/buildkit/util/system)
-BuildRequires: golang(github.com/moby/buildkit/util/tracing)
-BuildRequires: golang(github.com/moby/buildkit/worker)
-BuildRequires: golang(github.com/moby/locker)
-BuildRequires: golang(github.com/moby/sys/mount)
-BuildRequires: golang(github.com/moby/sys/mountinfo)
-BuildRequires: golang(github.com/moby/sys/symlink)
-BuildRequires: golang(github.com/moby/term)
-BuildRequires: golang(github.com/morikuni/aec)
-BuildRequires: golang(github.com/opencontainers/go-digest)
-BuildRequires: golang(github.com/opencontainers/image-spec/identity)
-BuildRequires: golang(github.com/opencontainers/image-spec/specs-go/v1)
-BuildRequires: golang(github.com/opencontainers/runc/libcontainer/apparmor)
-BuildRequires: golang(github.com/opencontainers/runc/libcontainer/cgroups)
-BuildRequires: golang(github.com/opencontainers/runc/libcontainer/configs)
-BuildRequires: golang(github.com/opencontainers/runc/libcontainer/devices)
-BuildRequires: golang(github.com/opencontainers/runc/libcontainer/user)
-BuildRequires: golang(github.com/opencontainers/runtime-spec/specs-go)
-BuildRequires: golang(github.com/opencontainers/selinux/go-selinux)
-BuildRequires: golang(github.com/opencontainers/selinux/go-selinux/label)
-BuildRequires: golang(github.com/pkg/errors)
-BuildRequires: golang(github.com/prometheus/client_golang/prometheus)
-BuildRequires: golang(github.com/RackSec/srslog)
-BuildRequires: golang(github.com/sirupsen/logrus)
-BuildRequires: golang(github.com/spf13/cobra)
-BuildRequires: golang(github.com/spf13/pflag)
-BuildRequires: golang(github.com/syndtr/gocapability/capability)
-BuildRequires: golang(github.com/tchap/go-patricia/patricia)
-BuildRequires: golang(github.com/tonistiigi/fsutil)
-BuildRequires: golang(github.com/vbatts/tar-split/tar/asm)
-BuildRequires: golang(github.com/vbatts/tar-split/tar/storage)
-BuildRequires: golang(github.com/vishvananda/netlink)
-BuildRequires: golang(go.etcd.io/bbolt)
-BuildRequires: golang(golang.org/x/net/http2)
-BuildRequires: golang(golang.org/x/net/websocket)
-BuildRequires: golang(golang.org/x/sync/errgroup)
-BuildRequires: golang(golang.org/x/sync/semaphore)
-BuildRequires: golang(golang.org/x/sync/syncmap)
-BuildRequires: golang(golang.org/x/sys/execabs)
-BuildRequires: golang(golang.org/x/sys/unix)
-BuildRequires: golang(golang.org/x/time/rate)
-BuildRequires: golang(google.golang.org/genproto/googleapis/api/monitoredres)
-BuildRequires: golang(google.golang.org/grpc)
-BuildRequires: golang(google.golang.org/grpc/backoff)
-BuildRequires: golang(google.golang.org/grpc/codes)
-BuildRequires: golang(google.golang.org/grpc/metadata)
-BuildRequires: golang(google.golang.org/grpc/status)
-BuildRequires: golang(gotest.tools/v3/assert)
-BuildRequires: golang(gotest.tools/v3/assert/cmp)
-BuildRequires: golang(gotest.tools/v3/fs)
-BuildRequires: golang(gotest.tools/v3/icmd)
-BuildRequires: golang(gotest.tools/v3/poll)
-BuildRequires: golang(gotest.tools/v3/skip)
-
-%if %{with check}
-# Tests
-BuildRequires: golang(github.com/gogo/protobuf/io)
-BuildRequires: golang(github.com/google/go-cmp/cmp)
-BuildRequires: golang(github.com/google/go-cmp/cmp/cmpopts)
-BuildRequires: golang(gotest.tools/v3/env)
-%endif
-%endif
BuildRequires: git-core
BuildRequires: pkgconfig(libseccomp)
+%if %{without bootstrap}
+BuildRequires: golang(github.com/agext/levenshtein)
+BuildRequires: golang(github.com/gofrs/flock)
+BuildRequires: golang(github.com/google/shlex)
+BuildRequires: golang(github.com/mitchellh/hashstructure)
+BuildRequires: golang(github.com/moby/buildkit/source/types)
+BuildRequires: golang(github.com/moby/buildkit/util/buildinfo/types)
+BuildRequires: golang(github.com/moby/buildkit/util/resolver/config)
+BuildRequires: golang(github.com/tonistiigi/units)
+%endif
%description
%{common_description}
@@ -286,47 +65,39 @@ BuildRequires: pkgconfig(libseccomp)
%gopkg
%prep
-%if %{with bootstrap}
-%goprep -k
-%else
%goprep
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+sed -i "s|github.com/docker/distribution|github.com/distribution/distribution/v3|" $(find . -iname "*.go" -type f)
+
+%if %{without bootstrap}
+%generate_buildrequires
+%go_generate_buildrequires
%endif
-%autopatch -p1
# %%build
# for cmd in cmd/* ; do
-# %%gobuild -o %%{gobuilddir}/bin/$(basename $cmd) %%{goipath}/$cmd
+# %%gobuild -o %%{gobuilddir}/bin/$(basename $cmd) %%{goipath}/$cmd
# done
%install
-%if %{with bootstrap}
-mapfile -t vendor <<< $(find vendor -type f)
-%endif
%gopkginstall
# install -m 0755 -vd %%{buildroot}%%{_bindir}
# install -m 0755 -vp %%{gobuilddir}/bin/* %%{buildroot}%%{_bindir}/
+%if %{without bootstrap}
%if %{with check}
%check
-%gocheck -d builder/dockerfile \
- -t daemon \
- -d distribution \
- -t cmd/dockerd \
- -d integration/network \
- -d pkg/authorization \
- -d pkg/chrootarchive \
- -d plugin \
- -d pkg/mount \
- -d pkg/signal \
- -d pkg/fileutils \
- -d pkg/system
+%gocheck
+%endif
%endif
-# %%files
-# %%license LICENSE NOTICE
-# %%doc docs AUTHORS CHANGELOG.md CONTRIBUTING.md README.md ROADMAP.md TESTING.md
-# %%doc VENDORING.md
-# %%{_bindir}/*
+# %files
+# %license LICENSE NOTICE
+# %doc docs AUTHORS CHANGELOG.md CONTRIBUTING.md README.md ROADMAP.md SECURITY.md
+# %doc TESTING.md VENDORING.md api/README.md
+# %{_bindir}/*
%gopkgfiles
diff --git a/sources b/sources
index b1c4e72..d07bd5a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (moby-20.10.12.tar.gz) = f4122c8cbc67e6b7703856dc76d6f15d7fab1b2001d4916b89958d5319c16d8b8445881841ef4804e8d47d64694184aec1be93e22d7baceb021c4a99c2c03753
+SHA512 (moby-22.06.0-beta.0.tar.gz) = c071011c20f3999f89d9bd81d5a883b7c3068f8783497251e07a71a8607f5dd0c04b3fb2358f2d7c4f2a2beb04dd069d5c3ba88561c986c3769c027887b618e7
https://src.fedoraproject.org/rpms/golang-github-docker/c/235c3e3ffc35603...
1Â year, 7Â months
pagure pushed to rpms/kiwi (rawhide). "Backport patch for being able
to build OCI containers in Mock (nspawn)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-10-22 14:58:31 UTC
From 1bdb7501e322a0a55616352c11aad134e1c443d7 Mon Sep 17 00:00:00 2001
From: Igor Raits <igor(a)gooddata.com>
Date: Oct 22 2022 09:02:52 +0000
Subject: Backport patch for being able to build OCI containers in Mock (nspawn)
---
diff --git a/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
new file mode 100644
index 0000000..1c1fe56
--- /dev/null
+++ b/0001-Stop-copying-dev-files-statically-into-the-OCI-conta.patch
@@ -0,0 +1,126 @@
+From 1f547d6bb994d7d0cbed857b1b8d9b4ec79081be Mon Sep 17 00:00:00 2001
+From: Igor Raits <igor.raits(a)gmail.com>
+Date: Wed, 12 Oct 2022 20:31:54 +0200
+Subject: [PATCH] Stop copying /dev files statically into the OCI container
+
+In containers (nspawn) where part of the /dev filesystem is bind-mounted
+from outside system, kiwi fails to do the rsync (in creation of the
+nodes).
+
+There is no reason to actually copy whole tree inside so let's just
+not do it (as it does not seem to be needed at all).
+---
+ kiwi/container/setup/base.py | 23 -----------------------
+ kiwi/container/setup/oci.py | 1 -
+ test/unit/container/setup/base_test.py | 20 --------------------
+ test/unit/container/setup/oci_test.py | 2 --
+ 4 files changed, 46 deletions(-)
+
+diff --git a/kiwi/container/setup/base.py b/kiwi/container/setup/base.py
+index d2fc56aa66..5a462889d0 100644
+--- a/kiwi/container/setup/base.py
++++ b/kiwi/container/setup/base.py
+@@ -20,7 +20,6 @@
+
+ # project
+ from kiwi.command import Command
+-from kiwi.utils.sync import DataSync
+
+ from kiwi.exceptions import (
+ KiwiContainerSetupError
+@@ -145,28 +144,6 @@ def setup_root_console(self):
+ }
+ )
+
+- def setup_static_device_nodes(self):
+- """
+- Container device node setup
+-
+- Without subsystems like udev running in a container it is
+- required to provide a set of device nodes to let the
+- system in the container function correctly. This is
+- done by syncing the host system nodes to the container.
+- That this will also create device nodes which are not
+- necessarily present in the container later is a know
+- limitation of this method and considered harmless
+- """
+- try:
+- data = DataSync('/dev/', self.root_dir + '/dev/')
+- data.sync_data(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+- except Exception as e:
+- raise KiwiContainerSetupError(
+- 'Failed to create static container nodes %s' % format(e)
+- )
+-
+ def get_container_name(self):
+ """
+ Container name
+diff --git a/kiwi/container/setup/oci.py b/kiwi/container/setup/oci.py
+index 915b56c794..cbc284550e 100644
+--- a/kiwi/container/setup/oci.py
++++ b/kiwi/container/setup/oci.py
+@@ -50,7 +50,6 @@ def setup(self):
+
+ self.deactivate_bootloader_setup()
+ self.deactivate_root_filesystem_check()
+- self.setup_static_device_nodes()
+ self.setup_root_console()
+
+ for service in services_to_deactivate:
+diff --git a/test/unit/container/setup/base_test.py b/test/unit/container/setup/base_test.py
+index b77fa93cd4..d1741c9dbb 100644
+--- a/test/unit/container/setup/base_test.py
++++ b/test/unit/container/setup/base_test.py
+@@ -2,7 +2,6 @@
+ patch, call, mock_open
+ )
+ from pytest import raises
+-import mock
+
+ from kiwi.container.setup.base import ContainerSetupBase
+
+@@ -102,22 +101,3 @@ def test_setup_root_console(self, mock_exists):
+ assert m_open.return_value.write.call_args_list == [
+ call('\nconsole\n')
+ ]
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- @patch('kiwi.container.setup.base.DataSync')
+- def test_setup_static_device_nodes(self, mock_DataSync, mock_command):
+- data = mock.Mock()
+- mock_DataSync.return_value = data
+- self.container.setup_static_device_nodes()
+- mock_DataSync.assert_called_once_with(
+- '/dev/', 'root_dir/dev/'
+- )
+- data.sync_data.assert_called_once_with(
+- options=['-a', '-x', '--devices', '--specials']
+- )
+-
+- @patch('kiwi.container.setup.base.Command.run')
+- def test_setup_static_device_nodes_failed(self, mock_command):
+- mock_command.side_effect = Exception
+- with raises(KiwiContainerSetupError):
+- self.container.setup_static_device_nodes()
+diff --git a/test/unit/container/setup/oci_test.py b/test/unit/container/setup/oci_test.py
+index f5ef5022d5..59a1496a29 100644
+--- a/test/unit/container/setup/oci_test.py
++++ b/test/unit/container/setup/oci_test.py
+@@ -16,7 +16,6 @@ def setup(self, mock_exists):
+
+ self.container.deactivate_bootloader_setup = mock.Mock()
+ self.container.deactivate_root_filesystem_check = mock.Mock()
+- self.container.setup_static_device_nodes = mock.Mock()
+ self.container.setup_root_console = mock.Mock()
+ self.container.deactivate_systemd_service = mock.Mock()
+
+@@ -28,7 +27,6 @@ def test_setup(self):
+ self.container.setup()
+ self.container.deactivate_bootloader_setup.assert_called_once_with()
+ self.container.deactivate_root_filesystem_check.assert_called_once_with()
+- self.container.setup_static_device_nodes.assert_called_once_with()
+ assert self.container.deactivate_systemd_service.call_args_list == [
+ call('device-mapper.service'),
+ call('kbd.service'),
diff --git a/kiwi.spec b/kiwi.spec
index e7a36b9..f2903f3 100644
--- a/kiwi.spec
+++ b/kiwi.spec
@@ -12,7 +12,7 @@ and cloud systems like Xen, KVM, VMware, EC2 and more.
Name: kiwi
Version: 9.24.48
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://osinside.github.io/kiwi/
Summary: Flexible operating system image builder
License: GPLv3+
@@ -20,6 +20,7 @@ License: GPLv3+
Source0: https://files.pythonhosted.org/packages/source/k/%{name}/%{name}-%{versio...
# Backports from upstream
+Patch1002: https://github.com/OSInside/kiwi/pull/2195.patch#/0001-Stop-copying-dev-f...
# Fedora-specific patches
## Use buildah instead of umoci by default for OCI image builds
@@ -540,6 +541,9 @@ done
# Empty metapackage
%changelog
+* Sat Oct 22 2022 Igor Raits <igor(a)gooddata.com> - 9.24.48-2
+- Backport patch for being able to build OCI containers in Mock (nspawn)
+
* Wed Sep 14 2022 Neal Gompa <ngompa(a)fedoraproject.org> - 9.24.48-1
- Update to 9.24.48 (RH#2106248)
https://src.fedoraproject.org/rpms/kiwi/c/1bdb7501e322a0a55616352c11aad13...
1Â year, 7Â months