From 2ef3771c9e7a41c143909ae59e003ae4107f385c Mon Sep 17 00:00:00 2001 From: Natan Date: Sun, 19 Apr 2026 22:34:48 -0300 Subject: [PATCH 01/20] test: close client after tests --- .../kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt index f8767051..cd520d7c 100644 --- a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt +++ b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt @@ -2,6 +2,7 @@ package me.devnatan.dockerkt.resource import me.devnatan.dockerkt.DockerClient import me.devnatan.dockerkt.createTestDockerClient +import kotlin.test.AfterTest open class ResourceIT( private val debugHttpCalls: Boolean = true, @@ -11,4 +12,9 @@ open class ResourceIT( debugHttpCalls(this@ResourceIT.debugHttpCalls) } } + + @AfterTest + fun closeTestClient() { + runCatching { testClient.close() } + } } From 0ee1f8a29352f126545f0700beeab4386b0f454c Mon Sep 17 00:00:00 2001 From: Natan Date: Sun, 19 Apr 2026 22:39:45 -0300 Subject: [PATCH 02/20] fix: set native http client request timeout to infinite --- src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt b/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt index bef573e0..566dc6f0 100644 --- a/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt +++ b/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt @@ -10,6 +10,11 @@ import me.devnatan.dockerkt.DockerClient internal actual val defaultHttpClientEngine: HttpClientEngineFactory<*>? get() = CIO internal actual fun HttpClientConfig.configureHttpClient(client: DockerClient) { + engine { + require(this is io.ktor.client.engine.cio.CIOEngineConfig) { "Only CIO engine is supported for now" } + // disable request timeout so long-running calls (image pulls, log streams) aren't killed + requestTimeout = 0 + } defaultRequest { val socketPath = client.config.socketPath if (isUnixSocket(socketPath)) { From e695e47e49ca4e63ee0d6c35458c5a6ba0cf0d47 Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 14:18:40 -0300 Subject: [PATCH 03/20] fix: strip unix socket prefix --- src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt b/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt index 566dc6f0..59602f0d 100644 --- a/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt +++ b/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt @@ -18,7 +18,7 @@ internal actual fun HttpClientConfig.configu defaultRequest { val socketPath = client.config.socketPath if (isUnixSocket(socketPath)) { - unixSocket(socketPath) + unixSocket(socketPath.removePrefix(UnixSocketPrefix)) } } } From b608125d63ed07d3fd03c370b701fb3ef533df4f Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 14:31:51 -0300 Subject: [PATCH 04/20] chore: upload CI test reports --- .github/workflows/integration-tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index d18c9681..11b791d5 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -49,6 +49,13 @@ jobs: - name: Run Tests run: ./gradlew jvmTest + + - name: Upload test reports + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test-report-jvm + path: build/reports/tests/ native: if: ${{ vars.NATIVE_TESTS_ENABLED == 'true' }} strategy: @@ -111,3 +118,10 @@ jobs: - name: Run Tests run: ./gradlew ${{ matrix.os.sourceset }}Test + + - name: Upload test reports + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test-report-${{ matrix.os.sourceset }} + path: build/reports/tests/ From 741dd337425d419d682cb7af37202fd89cb17463 Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 14:46:11 -0300 Subject: [PATCH 05/20] chore: pin to ubuntu-24.04 --- .github/workflows/integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 11b791d5..d731e283 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -22,7 +22,7 @@ jobs: matrix: docker_version: - "29.2.1" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 name: JVM steps: - name: Checkout @@ -65,7 +65,7 @@ jobs: - "29.2.1" os: - name: Linux - runner: ubuntu-22.04 + runner: ubuntu-24.04 sourceset: linuxX64 - name: macOS (Intel) From 3169b65c40a875e1593f75c353327a99f044c369 Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 14:46:50 -0300 Subject: [PATCH 06/20] fix: remove explicit `contentType` attribution --- .../dockerkt/resource/container/ContainerResource.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/commonMain/kotlin/me/devnatan/dockerkt/resource/container/ContainerResource.kt b/src/commonMain/kotlin/me/devnatan/dockerkt/resource/container/ContainerResource.kt index da1d5bd6..a11cf842 100644 --- a/src/commonMain/kotlin/me/devnatan/dockerkt/resource/container/ContainerResource.kt +++ b/src/commonMain/kotlin/me/devnatan/dockerkt/resource/container/ContainerResource.kt @@ -14,6 +14,7 @@ import io.ktor.client.statement.bodyAsChannel import io.ktor.client.statement.readRawBytes import io.ktor.http.ContentType import io.ktor.http.HttpStatusCode +import io.ktor.http.content.ByteArrayContent import io.ktor.http.contentType import io.ktor.util.decodeBase64Bytes import io.ktor.utils.io.ByteReadChannel @@ -513,8 +514,10 @@ public class ContainerResource internal constructor( parameter("noOverwriteDirNonDir", options.noOverwriteDirNonDir.toString()) parameter("copyUIDGID", options.copyUIDGID.toString()) - setBody(tarArchive) - contentType(ContentType.Application.OctetStream) + // ByteArrayContent guarantees Content-Length is set; plain setBody(ByteArray) can fall + // back to chunked transfer on Ktor CIO native, which Docker's archive endpoint rejects + // with "request body length should be specified". + setBody(ByteArrayContent(tarArchive, ContentType.Application.OctetStream)) } } From c775fd8e026191c72463604f781b7ab7874e2e0d Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 15:05:25 -0300 Subject: [PATCH 07/20] test: ResourceIT default constructor --- .../kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt index cd520d7c..d81bd674 100644 --- a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt +++ b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/ResourceIT.kt @@ -2,11 +2,14 @@ package me.devnatan.dockerkt.resource import me.devnatan.dockerkt.DockerClient import me.devnatan.dockerkt.createTestDockerClient +import kotlin.jvm.JvmOverloads import kotlin.test.AfterTest open class ResourceIT( - private val debugHttpCalls: Boolean = true, + private val debugHttpCalls: Boolean, ) { + constructor() : this(debugHttpCalls = true) + val testClient: DockerClient by lazy { createTestDockerClient { debugHttpCalls(this@ResourceIT.debugHttpCalls) From 56207e90c554f3fd76010c60ce9816e092cacf3a Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 15:17:16 -0300 Subject: [PATCH 08/20] chore: downgrade CI Docker CE to v27 --- .github/workflows/integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index d731e283..99e8dafa 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: docker_version: - - "29.2.1" + - "27.5.1" runs-on: ubuntu-24.04 name: JVM steps: @@ -62,7 +62,7 @@ jobs: fail-fast: false matrix: docker_version: - - "29.2.1" + - "27.5.1" os: - name: Linux runner: ubuntu-24.04 From 0c7145a4e0118484f316fbf0e14f872730c56d98 Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 15:17:26 -0300 Subject: [PATCH 09/20] fix: force close connection header --- .../kotlin/me/devnatan/dockerkt/io/Http.native.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt b/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt index 59602f0d..eea2c92c 100644 --- a/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt +++ b/src/nativeMain/kotlin/me/devnatan/dockerkt/io/Http.native.kt @@ -5,6 +5,8 @@ import io.ktor.client.engine.HttpClientEngineConfig import io.ktor.client.engine.HttpClientEngineFactory import io.ktor.client.engine.cio.CIO import io.ktor.client.plugins.defaultRequest +import io.ktor.client.request.header +import io.ktor.http.HttpHeaders import me.devnatan.dockerkt.DockerClient internal actual val defaultHttpClientEngine: HttpClientEngineFactory<*>? get() = CIO @@ -20,5 +22,10 @@ internal actual fun HttpClientConfig.configu if (isUnixSocket(socketPath)) { unixSocket(socketPath.removePrefix(UnixSocketPrefix)) } + // Force Connection: close. Docker often returns bodies framed by connection-close (no + // Content-Length, no Transfer-Encoding), and Ktor CIO over unix sockets cannot otherwise + // determine where the response ends — throwing "request body length should be specified, + // chunked transfer encoding should be used or keep-alive should be disabled (connection: close)". + header(HttpHeaders.Connection, "close") } } From 9caa4f598c6a01211191ec029322e96683c7c3b8 Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 15:21:44 -0300 Subject: [PATCH 10/20] chore: switch to legacy iptables --- .github/workflows/integration-tests.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 99e8dafa..f66e92dc 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: docker_version: - - "27.5.1" + - "29.2.1" runs-on: ubuntu-24.04 name: JVM steps: @@ -30,6 +30,11 @@ jobs: with: fetch-depth: 0 + - name: Switch to iptables-legacy + run: | + sudo update-alternatives --set iptables /usr/sbin/iptables-legacy + sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy + - name: Setup Docker CE v${{ matrix.docker_version }} uses: docker/setup-docker-action@v4.6.0 with: @@ -62,7 +67,7 @@ jobs: fail-fast: false matrix: docker_version: - - "27.5.1" + - "29.2.1" os: - name: Linux runner: ubuntu-24.04 @@ -88,6 +93,12 @@ jobs: with: fetch-depth: 0 + - name: Switch to iptables-legacy + if: ${{ matrix.os.sourceset == 'linuxX64' }} + run: | + sudo update-alternatives --set iptables /usr/sbin/iptables-legacy + sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy + - name: Setup Docker CE v${{ matrix.docker_version }} uses: docker/setup-docker-action@v4.6.0 if: ${{ matrix.os.sourceset != 'macosArm64' }} From 45617607470d9c6c426b2af9f0c7cd1431b0f9a7 Mon Sep 17 00:00:00 2001 From: Natan Date: Mon, 20 Apr 2026 15:33:27 -0300 Subject: [PATCH 11/20] chore: downgrade CI Docker CE to v28 --- .github/workflows/integration-tests.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index f66e92dc..9b3028fc 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: docker_version: - - "29.2.1" + - "28.3.3" runs-on: ubuntu-24.04 name: JVM steps: @@ -30,11 +30,6 @@ jobs: with: fetch-depth: 0 - - name: Switch to iptables-legacy - run: | - sudo update-alternatives --set iptables /usr/sbin/iptables-legacy - sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy - - name: Setup Docker CE v${{ matrix.docker_version }} uses: docker/setup-docker-action@v4.6.0 with: @@ -67,7 +62,7 @@ jobs: fail-fast: false matrix: docker_version: - - "29.2.1" + - "28.3.3" os: - name: Linux runner: ubuntu-24.04 @@ -93,12 +88,6 @@ jobs: with: fetch-depth: 0 - - name: Switch to iptables-legacy - if: ${{ matrix.os.sourceset == 'linuxX64' }} - run: | - sudo update-alternatives --set iptables /usr/sbin/iptables-legacy - sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy - - name: Setup Docker CE v${{ matrix.docker_version }} uses: docker/setup-docker-action@v4.6.0 if: ${{ matrix.os.sourceset != 'macosArm64' }} From b6692c9c8cf44999b96e0b3a51e3d4c65979bc26 Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 13:34:58 -0300 Subject: [PATCH 12/20] test: wait container in logs with large output --- .../me/devnatan/dockerkt/resource/container/LogContainerIT.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/LogContainerIT.kt b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/LogContainerIT.kt index 2c7ab51b..cb760d7c 100644 --- a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/LogContainerIT.kt +++ b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/LogContainerIT.kt @@ -257,8 +257,7 @@ class LogContainerIT : ResourceIT() { }, ) { container -> testClient.containers.start(container) - - delay(3000) + testClient.containers.wait(container) val result = testClient.containers.logs(container) { From a147a5c226ad45aae2d5f0f74f82a2c84468ec53 Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 13:54:49 -0300 Subject: [PATCH 13/20] test: use temp file to archives exec --- .../container/CopyContainerArchivesIT.kt | 63 ++++++++++--------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt index 3fea58bd..4eb4dac8 100644 --- a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt +++ b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt @@ -4,10 +4,7 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.test.runTest import kotlinx.io.files.Path import me.devnatan.dockerkt.io.FileSystemUtils -import me.devnatan.dockerkt.models.exec.ExecStartOptions -import me.devnatan.dockerkt.models.exec.ExecStartResult import me.devnatan.dockerkt.resource.ResourceIT -import me.devnatan.dockerkt.resource.exec.create import me.devnatan.dockerkt.sleepForever import me.devnatan.dockerkt.withContainer import kotlin.test.Test @@ -76,15 +73,22 @@ class CopyContainerArchivesIT : ResourceIT() { "/tmp/", ) - val execId = - testClient.exec.create(id) { - command = listOf("cat", "/tmp/${tempFile.name}") - attachStdout = true - } - - val result = testClient.exec.start(execId, ExecStartOptions()) - assertTrue(result is ExecStartResult.Complete) - assertTrue(result.output.contains("hello from host")) + val verifyDir = FileSystemUtils.createTempDirectory() + try { + testClient.containers.copyFileFrom( + id, + "/tmp/${tempFile.name}", + verifyDir.toString(), + ) + val copiedBack = Path(verifyDir, tempFile.name) + assertTrue(FileSystemUtils.exists(copiedBack)) + assertEquals( + expected = "hello from host", + actual = FileSystemUtils.readFile(copiedBack).decodeToString(), + ) + } finally { + FileSystemUtils.deleteRecursively(verifyDir) + } } finally { FileSystemUtils.delete(tempFile) testClient.containers.stop(id) @@ -165,24 +169,23 @@ class CopyContainerArchivesIT : ResourceIT() { "/tmp/", ) - val execId = - testClient.exec.create(id) { - command = listOf("sh", "-c", "cat /tmp/file1.txt && cat /tmp/file2.txt") - attachStdout = true - } - - val result = testClient.exec.start(execId, ExecStartOptions()) - assertTrue(result is ExecStartResult.Complete) - - val output = result.output - assertTrue( - actual = output.contains("content1"), - message = "Expected 'content1' in output, but got: $output", - ) - assertTrue( - actual = output.contains("content2"), - message = "Expected 'content2' in output, but got: $output", - ) + val verifyDir = FileSystemUtils.createTempDirectory() + try { + val srcName = tempDir.name + testClient.containers.copyDirectoryFrom( + id, + "/tmp/$srcName", + verifyDir.toString(), + ) + val copiedFile1 = Path(verifyDir, "$srcName/file1.txt") + val copiedFile2 = Path(verifyDir, "$srcName/file2.txt") + assertTrue(FileSystemUtils.exists(copiedFile1)) + assertTrue(FileSystemUtils.exists(copiedFile2)) + assertEquals("content1", FileSystemUtils.readFile(copiedFile1).decodeToString()) + assertEquals("content2", FileSystemUtils.readFile(copiedFile2).decodeToString()) + } finally { + FileSystemUtils.deleteRecursively(verifyDir) + } } finally { FileSystemUtils.deleteRecursively(tempDir) testClient.containers.stop(id) From 13f405a2668243f479f2c759a05c25e4d1aee390 Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 14:01:09 -0300 Subject: [PATCH 14/20] test: unflatten archive copy --- .../resource/container/CopyContainerArchivesIT.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt index 4eb4dac8..f98da3d4 100644 --- a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt +++ b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt @@ -171,14 +171,10 @@ class CopyContainerArchivesIT : ResourceIT() { val verifyDir = FileSystemUtils.createTempDirectory() try { - val srcName = tempDir.name - testClient.containers.copyDirectoryFrom( - id, - "/tmp/$srcName", - verifyDir.toString(), - ) - val copiedFile1 = Path(verifyDir, "$srcName/file1.txt") - val copiedFile2 = Path(verifyDir, "$srcName/file2.txt") + testClient.containers.copyFileFrom(id, "/tmp/file1.txt", verifyDir.toString()) + testClient.containers.copyFileFrom(id, "/tmp/file2.txt", verifyDir.toString()) + val copiedFile1 = Path(verifyDir, "file1.txt") + val copiedFile2 = Path(verifyDir, "file2.txt") assertTrue(FileSystemUtils.exists(copiedFile1)) assertTrue(FileSystemUtils.exists(copiedFile2)) assertEquals("content1", FileSystemUtils.readFile(copiedFile1).decodeToString()) From d5d4d34fe3edfb7bd9a4656d84385fdb2a6ac19d Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 14:05:28 -0300 Subject: [PATCH 15/20] chore: remove mac silicon tests --- .github/workflows/integration-tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 9b3028fc..c8ce7a74 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -68,14 +68,10 @@ jobs: runner: ubuntu-24.04 sourceset: linuxX64 - - name: macOS (Intel) + - name: macOS runner: macos-15-intel sourceset: macosX64 - - name: macOS (Apple Silicon) - runner: macos-15 - sourceset: macosArm64 - - name: Windows runner: windows-2025 sourceset: mingwX64 From 7f0e6f61574edfe3dfea27bb97335ded8187c758 Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 14:06:21 -0300 Subject: [PATCH 16/20] chore: remove Docker CE version matrix --- .github/workflows/integration-tests.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c8ce7a74..7db138ff 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -7,6 +7,7 @@ on: env: DOCKER_API_VERSION: 1.48 + DOCKER_CE_VERSION: 28.3.3 concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -17,11 +18,6 @@ permissions: jobs: jvm: - strategy: - fail-fast: false - matrix: - docker_version: - - "28.3.3" runs-on: ubuntu-24.04 name: JVM steps: @@ -30,10 +26,10 @@ jobs: with: fetch-depth: 0 - - name: Setup Docker CE v${{ matrix.docker_version }} + - name: Setup Docker CE uses: docker/setup-docker-action@v4.6.0 with: - version: v${{ matrix.docker_version }} + version: v${{ env.DOCKER_CE_VERSION }} - name: Set up JDK 17 uses: actions/setup-java@v5 @@ -61,8 +57,6 @@ jobs: strategy: fail-fast: false matrix: - docker_version: - - "28.3.3" os: - name: Linux runner: ubuntu-24.04 @@ -84,11 +78,11 @@ jobs: with: fetch-depth: 0 - - name: Setup Docker CE v${{ matrix.docker_version }} + - name: Setup Docker CE uses: docker/setup-docker-action@v4.6.0 if: ${{ matrix.os.sourceset != 'macosArm64' }} with: - version: v${{ matrix.docker_version }} + version: v${{ env.DOCKER_CE_VERSION }} - name: Setup Homebrew uses: Homebrew/actions/setup-homebrew@master From 130a7f56330ba530a81cde1e647fa1b5de0e8985 Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 14:07:32 -0300 Subject: [PATCH 17/20] chore: remove native prefix from CI tests --- .github/workflows/integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 7db138ff..48797e40 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -71,7 +71,7 @@ jobs: sourceset: mingwX64 runs-on: ${{ matrix.os.runner }} - name: Native - ${{ matrix.os.name }} + name: ${{ matrix.os.name }} steps: - name: Checkout uses: actions/checkout@v6 From 5e963f34b3f8495b3e74bb073bba9685bdaaf18d Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 14:08:27 -0300 Subject: [PATCH 18/20] chore: remove macos arm64 conditionals --- .github/workflows/integration-tests.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 48797e40..2c196d8e 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -26,11 +26,6 @@ jobs: with: fetch-depth: 0 - - name: Setup Docker CE - uses: docker/setup-docker-action@v4.6.0 - with: - version: v${{ env.DOCKER_CE_VERSION }} - - name: Set up JDK 17 uses: actions/setup-java@v5 with: @@ -78,22 +73,6 @@ jobs: with: fetch-depth: 0 - - name: Setup Docker CE - uses: docker/setup-docker-action@v4.6.0 - if: ${{ matrix.os.sourceset != 'macosArm64' }} - with: - version: v${{ env.DOCKER_CE_VERSION }} - - - name: Setup Homebrew - uses: Homebrew/actions/setup-homebrew@master - if: ${{ matrix.os.sourceset == 'macosArm64' }} - - - name: Setup Docker - if: ${{ matrix.os.sourceset == 'macosArm64' }} - run: | - brew install colima docker - colima start - - name: Set up JDK 17 uses: actions/setup-java@v5 with: From a714662a9d11ab15d628d20ce2125796c0f86fe4 Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 14:10:57 -0300 Subject: [PATCH 19/20] chore: set up docker on macosX64 --- .github/workflows/integration-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 2c196d8e..179a1367 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -73,6 +73,12 @@ jobs: with: fetch-depth: 0 + - name: Setup Docker CE + uses: docker/setup-docker-action@v4.6.0 + if: ${{ matrix.os.sourceset == 'macosX64' }} + with: + version: v${{ env.DOCKER_CE_VERSION }} + - name: Set up JDK 17 uses: actions/setup-java@v5 with: From 00d5a03102919a425fa1ecdb2f61d49561e13ee6 Mon Sep 17 00:00:00 2001 From: Natan Date: Tue, 21 Apr 2026 14:11:34 -0300 Subject: [PATCH 20/20] test: wait containers instead of using `delay` --- .../resource/container/CopyContainerArchivesIT.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt index f98da3d4..f22f8eff 100644 --- a/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt +++ b/src/commonTest/kotlin/me/devnatan/dockerkt/resource/container/CopyContainerArchivesIT.kt @@ -1,6 +1,5 @@ package me.devnatan.dockerkt.resource.container -import kotlinx.coroutines.delay import kotlinx.coroutines.test.runTest import kotlinx.io.files.Path import me.devnatan.dockerkt.io.FileSystemUtils @@ -21,13 +20,11 @@ class CopyContainerArchivesIT : ResourceIT() { testClient.withContainer( testImage, { - command = listOf("sh", "-c", "echo 'test content' > /tmp/test.txt && sleep infinity") + command = listOf("sh", "-c", "echo 'test content' > /tmp/test.txt") }, ) { id -> testClient.containers.start(id) - - // Wait for file to be created - delay(500) + testClient.containers.wait(id) val tempDir = FileSystemUtils.createTempDirectory() try { @@ -47,7 +44,6 @@ class CopyContainerArchivesIT : ResourceIT() { ) } finally { FileSystemUtils.deleteRecursively(tempDir) - testClient.containers.stop(id) } } } @@ -106,13 +102,12 @@ class CopyContainerArchivesIT : ResourceIT() { listOf( "sh", "-c", - "mkdir -p /tmp/testdir && echo 'file1' > /tmp/testdir/file1.txt && echo 'file2' > /tmp/testdir/file2.txt && sleep infinity", + "mkdir -p /tmp/testdir && echo 'file1' > /tmp/testdir/file1.txt && echo 'file2' > /tmp/testdir/file2.txt", ) }, ) { id -> testClient.containers.start(id) - - delay(500) + testClient.containers.wait(id) val tempDir = FileSystemUtils.createTempDirectory() try { @@ -138,7 +133,6 @@ class CopyContainerArchivesIT : ResourceIT() { ) } finally { FileSystemUtils.deleteRecursively(tempDir) - testClient.containers.stop(id) } } }