Skip to content

Commit 03835c5

Browse files
authored
Merge branch 'main' into main
2 parents b3a79e4 + a434e35 commit 03835c5

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

.github/workflows/moby-latest.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
strategy:
1515
matrix:
1616
include:
17-
- { install-docker-type: "STABLE", channel: stable, rootless: false }
18-
- { install-docker-type: "ROOTLESS", channel: stable, rootless: true }
19-
- { install-docker-type: "ROOTFUL", channel: test, rootless: false }
17+
- { install-docker-type: "STABLE", version: latest, channel: stable, rootless: false }
18+
- { install-docker-type: "ROOTLESS", version: latest, channel: stable, rootless: true }
19+
- { install-docker-type: "ROOTFUL", version: edge, channel: test, rootless: false }
2020
name: "Core tests using Docker ${{ matrix.install-docker-type }} (channel ${{ matrix.channel }})"
2121
runs-on: ubuntu-22.04
2222
continue-on-error: true
@@ -28,6 +28,7 @@ jobs:
2828
id: setup_docker
2929
uses: docker/setup-docker-action@v4
3030
with:
31+
version: ${{ matrix.version }}
3132
channel: ${{ matrix.channel }}
3233
rootless: ${{ matrix.rootless }}
3334

core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ dependencies {
8080

8181
shaded 'org.awaitility:awaitility:4.3.0'
8282

83-
api platform('com.github.docker-java:docker-java-bom:3.6.0')
84-
shaded platform('com.github.docker-java:docker-java-bom:3.6.0')
83+
api platform('com.github.docker-java:docker-java-bom:3.7.0')
84+
shaded platform('com.github.docker-java:docker-java-bom:3.7.0')
8585

8686
api "com.github.docker-java:docker-java-api"
8787

core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ public static DockerClient getClientForConfig(TransportConfig transportConfig) {
404404
DefaultDockerClientConfig.Builder configBuilder = DefaultDockerClientConfig.createDefaultConfigBuilder();
405405

406406
if (configBuilder.build().getApiVersion() == RemoteApiVersion.UNKNOWN_VERSION) {
407-
configBuilder.withApiVersion(RemoteApiVersion.VERSION_1_32);
407+
configBuilder.withApiVersion(RemoteApiVersion.VERSION_1_44);
408408
}
409409
Map<String, String> headers = new HashMap<>();
410410
headers.put("x-tc-sid", DockerClientFactory.SESSION_ID);

core/src/test/java/org/testcontainers/junit/ComposeContainerWithBuildTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.testcontainers.utility.DockerImageName;
1111

1212
import java.io.File;
13+
import java.util.Collections;
1314
import java.util.concurrent.TimeUnit;
1415
import java.util.concurrent.atomic.AtomicReference;
1516
import java.util.stream.Stream;
@@ -97,7 +98,7 @@ private boolean isImagePresent(final String imageName) {
9798
.instance()
9899
.client()
99100
.listImagesCmd()
100-
.withImageNameFilter(imageName)
101+
.withFilter("reference", Collections.singletonList(imageName))
101102
.exec()
102103
.stream()
103104
.findFirst()

core/src/test/java/org/testcontainers/junit/DockerComposeContainerWithBuildTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.testcontainers.utility.DockerImageName;
1111

1212
import java.io.File;
13+
import java.util.Collections;
1314
import java.util.concurrent.TimeUnit;
1415
import java.util.concurrent.atomic.AtomicReference;
1516
import java.util.stream.Stream;
@@ -102,7 +103,7 @@ private boolean isImagePresent(final String imageName) {
102103
.instance()
103104
.client()
104105
.listImagesCmd()
105-
.withImageNameFilter(imageName)
106+
.withFilter("reference", Collections.singletonList(imageName))
106107
.exec()
107108
.stream()
108109
.findFirst()

examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceContainer.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@ protected void containerIsStarted(InspectContainerResponse containerInfo, boolea
2828
executeCommand("apt-get", "upgrade", "-y");
2929
executeCommand("apt-get", "install", "-y", "python3-pip");
3030
executeCommand("pip", "install", "huggingface-hub");
31-
executeCommand(
32-
"huggingface-cli",
33-
"download",
34-
huggingFaceModel.repository,
35-
huggingFaceModel.model,
36-
"--local-dir",
37-
"."
38-
);
31+
executeCommand("hf", "download", huggingFaceModel.repository, huggingFaceModel.model, "--local-dir", ".");
3932
executeCommand("sh", "-c", String.format("echo '%s' > Modelfile", huggingFaceModel.modelfileContent));
4033
executeCommand("ollama", "create", huggingFaceModel.model, "-f", "Modelfile");
4134
executeCommand("rm", huggingFaceModel.model);
@@ -48,7 +41,7 @@ private void executeCommand(String... command) throws ContainerLaunchException,
4841
ExecResult execResult = execInContainer(command);
4942
if (execResult.getExitCode() > 0) {
5043
throw new ContainerLaunchException(
51-
"Failed to execute " + String.join(" ", command) + ": " + execResult.getStderr()
44+
"Failed to execute " + String.join(" ", command) + ": " + execResult.getStdout()
5245
);
5346
}
5447
}

0 commit comments

Comments
 (0)