From aeee21995b6d1097f494e8c2a54f48f874ef02df Mon Sep 17 00:00:00 2001 From: Mish <10400064+mishushakov@users.noreply.github.com> Date: Thu, 9 Oct 2025 00:27:46 +0200 Subject: [PATCH 1/5] commit --- template/customization/base-image.mdx | 10 ++++---- template/customization/defining-template.mdx | 26 ++++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/template/customization/base-image.mdx b/template/customization/base-image.mdx index ec7ccef..3abf939 100644 --- a/template/customization/base-image.mdx +++ b/template/customization/base-image.mdx @@ -13,20 +13,20 @@ When creating a template, you can specify options: ```typescript const template = Template({ fileContextPath: ".", // Custom file context path - ignoreFilePaths: [".git", "node_modules"], // File patterns to ignore + ignoreFilePatterns: [".git", "node_modules"], // File patterns to ignore }); ``` ```python template = Template( file_context_path=".", # Custom file context path - ignore_file_paths=[".git", "node_modules"], # File patterns to ignore + ignore_file_patterns=[".git", "node_modules"], # File patterns to ignore ) ``` -**File ignoring**: The SDK automatically reads `.dockerignore` files and combines them with your `ignoreFilePaths`. Files matching these patterns are excluded from uploads and hash calculations. +**File ignoring**: The SDK automatically reads `.dockerignore` files and combines them with your `ignoreFilePatterns`. Files matching these patterns are excluded from uploads and hash calculations. ## Defining base image Choose from predefined base images or use custom ones: @@ -163,14 +163,14 @@ If your base image is hosted in a private registry, you can provide credentials ```typescript -Template().fromRegistry('ubuntu:22.04', { +Template().fromImage('ubuntu:22.04', { username: 'user', password: 'pass', }) ``` ```python -Template().from_registry( +Template().from_image( image="ubuntu:22.04", username="user", password="pass", diff --git a/template/customization/defining-template.mdx b/template/customization/defining-template.mdx index 46908ba..625c6d2 100644 --- a/template/customization/defining-template.mdx +++ b/template/customization/defining-template.mdx @@ -68,8 +68,11 @@ Copy files from your local filesystem to the template: // Copy a single file template.copy("package.json", "/app/package.json"); -// Copy multiple files -template.copy([ +// Copy multiple files to same destination +template.copy(["file1", "file2"], "/app/file") + +// Copy multiple files using copyItems +template.copyItems([ { src: "src/", dest: "/app/src/" }, { src: "package.json", dest: "/app/package.json" }, ]); @@ -85,8 +88,11 @@ template.copy("config.json", "/app/config.json", { # Copy a single file template.copy("package.json", "/app/package.json") -# Copy multiple files -template.copy([ +# Copy multiple files to same destination +template.copy(["file1", "file2"], "/app/file") + +# Copy multiple files using copy_items +template.copy_items([ {"src": "src/", "dest": "/app/src/"}, {"src": "package.json", "dest": "/app/package.json"}, ]) @@ -185,6 +191,9 @@ Clone Git repositories during template build (requires `git` to be installed): ```typescript // Clone a repository +template.gitClone('https://github.com/user/repo.git') + +// Clone a repository to a specific path template.gitClone('https://github.com/user/repo.git', '/app/repo') // Clone a specific branch @@ -192,17 +201,20 @@ template.gitClone('https://github.com/user/repo.git', '/app/repo', { branch: 'main', }) -// Clone with depth limit +// Shallow clone with depth limit template.gitClone('https://github.com/user/repo.git', '/app/repo', { depth: 1, }) ``` ```python -# Basic clone +# Clone a repository +template.git_clone("https://github.com/user/repo.git") + +# Clone a repository to a specific path template.git_clone("https://github.com/user/repo.git", "/app/repo") -# Clone specific branch +# Clone a specific branch template.git_clone("https://github.com/user/repo.git", "/app/repo", branch="main") # Shallow clone with depth limit From cdb825b02516862f7a6b73b8f9205bcf3a074859 Mon Sep 17 00:00:00 2001 From: Mish Ushakov <10400064+mishushakov@users.noreply.github.com> Date: Thu, 9 Oct 2025 00:38:51 +0200 Subject: [PATCH 2/5] Update template/customization/defining-template.mdx Co-authored-by: Jakub Dobry --- template/customization/defining-template.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/customization/defining-template.mdx b/template/customization/defining-template.mdx index 625c6d2..69602b3 100644 --- a/template/customization/defining-template.mdx +++ b/template/customization/defining-template.mdx @@ -71,7 +71,7 @@ template.copy("package.json", "/app/package.json"); // Copy multiple files to same destination template.copy(["file1", "file2"], "/app/file") -// Copy multiple files using copyItems +// Multiple copy operations using copyItems template.copyItems([ { src: "src/", dest: "/app/src/" }, { src: "package.json", dest: "/app/package.json" }, From 2e365844406ff7c4d749fdb1682e02f9348d9591 Mon Sep 17 00:00:00 2001 From: Mish Ushakov <10400064+mishushakov@users.noreply.github.com> Date: Thu, 9 Oct 2025 00:38:56 +0200 Subject: [PATCH 3/5] Update template/customization/defining-template.mdx Co-authored-by: Jakub Dobry --- template/customization/defining-template.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/customization/defining-template.mdx b/template/customization/defining-template.mdx index 69602b3..7bb73fd 100644 --- a/template/customization/defining-template.mdx +++ b/template/customization/defining-template.mdx @@ -91,7 +91,7 @@ template.copy("package.json", "/app/package.json") # Copy multiple files to same destination template.copy(["file1", "file2"], "/app/file") -# Copy multiple files using copy_items +# Multiple copy operations using copy_items template.copy_items([ {"src": "src/", "dest": "/app/src/"}, {"src": "package.json", "dest": "/app/package.json"}, From 534825e2aa97fd9dafc35bacaf64899cc29078c8 Mon Sep 17 00:00:00 2001 From: Mish Ushakov <10400064+mishushakov@users.noreply.github.com> Date: Thu, 9 Oct 2025 00:39:00 +0200 Subject: [PATCH 4/5] Update template/customization/defining-template.mdx Co-authored-by: Jakub Dobry --- template/customization/defining-template.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/customization/defining-template.mdx b/template/customization/defining-template.mdx index 7bb73fd..9d46645 100644 --- a/template/customization/defining-template.mdx +++ b/template/customization/defining-template.mdx @@ -88,7 +88,7 @@ template.copy("config.json", "/app/config.json", { # Copy a single file template.copy("package.json", "/app/package.json") -# Copy multiple files to same destination +# Copy multiple files to the same destination template.copy(["file1", "file2"], "/app/file") # Multiple copy operations using copy_items From 53260623588edb4374f814a7b5a98fd6c171976f Mon Sep 17 00:00:00 2001 From: Mish <10400064+mishushakov@users.noreply.github.com> Date: Thu, 9 Oct 2025 00:46:03 +0200 Subject: [PATCH 5/5] file ignore patterns rename --- template/customization/base-image.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/template/customization/base-image.mdx b/template/customization/base-image.mdx index 3abf939..85b54b0 100644 --- a/template/customization/base-image.mdx +++ b/template/customization/base-image.mdx @@ -13,20 +13,20 @@ When creating a template, you can specify options: ```typescript const template = Template({ fileContextPath: ".", // Custom file context path - ignoreFilePatterns: [".git", "node_modules"], // File patterns to ignore + fileIgnorePatterns: [".git", "node_modules"], // File patterns to ignore }); ``` ```python template = Template( file_context_path=".", # Custom file context path - ignore_file_patterns=[".git", "node_modules"], # File patterns to ignore + file_ignore_patterns=[".git", "node_modules"], # File patterns to ignore ) ``` -**File ignoring**: The SDK automatically reads `.dockerignore` files and combines them with your `ignoreFilePatterns`. Files matching these patterns are excluded from uploads and hash calculations. +**File ignoring**: The SDK automatically reads `.dockerignore` files and combines them with your `fileIgnorePatterns` (TypeScript) or `file_ignore_patterns` (Python). Files matching these patterns are excluded from uploads and hash calculations. ## Defining base image Choose from predefined base images or use custom ones: