From f11a2dfa1588add5209ed6e8ac025ab390a444c0 Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Fri, 30 Jan 2026 20:17:40 +0100 Subject: [PATCH 1/3] integration: Remove test_build_squash tests The --squash flag is no longer supported with BuildKit. Signed-off-by: Ricardo Branco --- tests/integration/api_build_test.py | 26 -------------------------- tests/ssh/api_build_test.py | 26 -------------------------- 2 files changed, 52 deletions(-) diff --git a/tests/integration/api_build_test.py b/tests/integration/api_build_test.py index 0f560159b3..0507e88420 100644 --- a/tests/integration/api_build_test.py +++ b/tests/integration/api_build_test.py @@ -349,32 +349,6 @@ def test_build_with_extra_hosts(self): assert '127.0.0.1\textrahost.local.test' in logs assert '127.0.0.1\thello.world.test' in logs - @requires_experimental(until=None) - @requires_api_version('1.25') - def test_build_squash(self): - script = io.BytesIO('\n'.join([ - 'FROM busybox', - 'RUN echo blah > /file_1', - 'RUN echo blahblah > /file_2', - 'RUN echo blahblahblah > /file_3' - ]).encode('ascii')) - - def build_squashed(squash): - tag = 'squash' if squash else 'nosquash' - stream = self.client.build( - fileobj=script, tag=tag, squash=squash - ) - self.tmp_imgs.append(tag) - for _chunk in stream: - pass - - return self.client.inspect_image(tag) - - non_squashed = build_squashed(False) - squashed = build_squashed(True) - assert len(non_squashed['RootFS']['Layers']) == 4 - assert len(squashed['RootFS']['Layers']) == 2 - def test_build_stderr_data(self): control_chars = ['\x1b[91m', '\x1b[0m'] snippet = 'Ancient Temple (Mystic Oriental Dream ~ Ancient Temple)' diff --git a/tests/ssh/api_build_test.py b/tests/ssh/api_build_test.py index f17c75630f..f57f935d6c 100644 --- a/tests/ssh/api_build_test.py +++ b/tests/ssh/api_build_test.py @@ -340,32 +340,6 @@ def test_build_with_extra_hosts(self): assert '127.0.0.1\textrahost.local.test' in logs assert '127.0.0.1\thello.world.test' in logs - @requires_experimental(until=None) - @requires_api_version('1.25') - def test_build_squash(self): - script = io.BytesIO('\n'.join([ - 'FROM busybox', - 'RUN echo blah > /file_1', - 'RUN echo blahblah > /file_2', - 'RUN echo blahblahblah > /file_3' - ]).encode('ascii')) - - def build_squashed(squash): - tag = 'squash' if squash else 'nosquash' - stream = self.client.build( - fileobj=script, tag=tag, squash=squash - ) - self.tmp_imgs.append(tag) - for _chunk in stream: - pass - - return self.client.inspect_image(tag) - - non_squashed = build_squashed(False) - squashed = build_squashed(True) - assert len(non_squashed['RootFS']['Layers']) == 4 - assert len(squashed['RootFS']['Layers']) == 2 - def test_build_stderr_data(self): control_chars = ['\x1b[91m', '\x1b[0m'] snippet = 'Ancient Temple (Mystic Oriental Dream ~ Ancient Temple)' From 8dd41cebcb44f128205d8f2e1864343a3ee44888 Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Fri, 30 Jan 2026 20:35:19 +0100 Subject: [PATCH 2/3] integration: Remove test_create_with_links Container links have been replaced by user-defined networks, which provide better isolation and flexibility without injecting environment variables. https://docs.docker.com/engine/network/links/ Signed-off-by: Ricardo Branco --- tests/integration/api_container_test.py | 47 ------------------------- 1 file changed, 47 deletions(-) diff --git a/tests/integration/api_container_test.py b/tests/integration/api_container_test.py index 21c2f35797..b625d428e9 100644 --- a/tests/integration/api_container_test.py +++ b/tests/integration/api_container_test.py @@ -64,53 +64,6 @@ def test_create_with_host_pid_mode(self): assert 'PidMode' in host_config assert host_config['PidMode'] == 'host' - def test_create_with_links(self): - res0 = self.client.create_container( - TEST_IMG, 'cat', - detach=True, stdin_open=True, - environment={'FOO': '1'}) - - container1_id = res0['Id'] - self.tmp_containers.append(container1_id) - - self.client.start(container1_id) - - res1 = self.client.create_container( - TEST_IMG, 'cat', - detach=True, stdin_open=True, - environment={'FOO': '1'}) - - container2_id = res1['Id'] - self.tmp_containers.append(container2_id) - - self.client.start(container2_id) - - # we don't want the first / - link_path1 = self.client.inspect_container(container1_id)['Name'][1:] - link_alias1 = 'mylink1' - link_env_prefix1 = link_alias1.upper() - - link_path2 = self.client.inspect_container(container2_id)['Name'][1:] - link_alias2 = 'mylink2' - link_env_prefix2 = link_alias2.upper() - - res2 = self.client.create_container( - TEST_IMG, 'env', host_config=self.client.create_host_config( - links={link_path1: link_alias1, link_path2: link_alias2}, - network_mode='bridge' - ) - ) - container3_id = res2['Id'] - self.tmp_containers.append(container3_id) - self.client.start(container3_id) - assert self.client.wait(container3_id)['StatusCode'] == 0 - - logs = self.client.logs(container3_id).decode('utf-8') - assert f'{link_env_prefix1}_NAME=' in logs - assert f'{link_env_prefix1}_ENV_FOO=1' in logs - assert f'{link_env_prefix2}_NAME=' in logs - assert f'{link_env_prefix2}_ENV_FOO=1' in logs - def test_create_with_restart_policy(self): container = self.client.create_container( TEST_IMG, ['sleep', '2'], From 4c28d017e6490c7579e0f87081da95206c6fe17e Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Mon, 14 Sep 2026 20:56:23 +0200 Subject: [PATCH 3/3] errors: Recognize Docker 29 ImageNotFound message Docker 29's containerd-backed image store returns 404s with the message 'failed to resolve reference "...": ...: not found' instead of 'No such image' when an image can't be found. This caused ContainerCollection.run()'s pull-retry path to raise a generic NotFound instead of the documented ImageNotFound, breaking callers that catch ImageNotFound specifically. Signed-off-by: Ricardo Branco --- docker/errors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/errors.py b/docker/errors.py index d03e10f693..d7fb78b2bb 100644 --- a/docker/errors.py +++ b/docker/errors.py @@ -6,6 +6,7 @@ 'not found: does not exist or no pull access', 'repository does not exist', 'was found but does not match the specified platform', + 'failed to resolve reference', ] )