diff --git a/template/customization/base-image.mdx b/template/customization/base-image.mdx index ec7ccef..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 - ignoreFilePaths: [".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_paths=[".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 `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 `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: @@ -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..9d46645 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") + +// Multiple copy operations 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 the same destination +template.copy(["file1", "file2"], "/app/file") + +# Multiple copy operations 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