Skip to content

Commit

Permalink
Fix OllamaContainer's commitToImage (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddumelendez authored Jul 1, 2024
1 parent 4059231 commit 7f39fba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/modules/ollama/src/ollama-container.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe("OllamaContainer", () => {
// commitToImage {
await container.commitToImage(newImageName);
// }
await container.stop();

// substitute {
const newContainer = await new OllamaContainer(newImageName).start();
Expand All @@ -37,7 +38,6 @@ describe("OllamaContainer", () => {
expect(response2.status).toEqual(200);
const body2 = await response2.json();
expect(body2.models[0].name).toContain("all-minilm");
await container.stop();
await newContainer.stop();
});
});
4 changes: 3 additions & 1 deletion packages/modules/ollama/src/ollama-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export class StartedOllamaContainer extends AbstractStartedContainer {
public async commitToImage(imageName: string): Promise<NodeJS.ReadableStream> {
const client = await getContainerRuntimeClient();
const dockerode = client.container.dockerode;
return dockerode.getContainer(this.getId()).commit({ repo: imageName });
return dockerode
.getContainer(this.getId())
.commit({ repo: imageName, Labels: { "org.testcontainers.session-id": "" } });
}
}

0 comments on commit 7f39fba

Please sign in to comment.