Skip to content

Commit aeee219

Browse files
committed
commit
1 parent bab1c9c commit aeee219

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

template/customization/base-image.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ When creating a template, you can specify options:
1313
```typescript
1414
const template = Template({
1515
fileContextPath: ".", // Custom file context path
16-
ignoreFilePaths: [".git", "node_modules"], // File patterns to ignore
16+
ignoreFilePatterns: [".git", "node_modules"], // File patterns to ignore
1717
});
1818
```
1919

2020
```python
2121
template = Template(
2222
file_context_path=".", # Custom file context path
23-
ignore_file_paths=[".git", "node_modules"], # File patterns to ignore
23+
ignore_file_patterns=[".git", "node_modules"], # File patterns to ignore
2424
)
2525
```
2626

2727
</CodeGroup>
2828

29-
**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.
29+
**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.
3030

3131
## Defining base image
3232
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
163163
<CodeGroup dropdown>
164164

165165
```typescript
166-
Template().fromRegistry('ubuntu:22.04', {
166+
Template().fromImage('ubuntu:22.04', {
167167
username: 'user',
168168
password: 'pass',
169169
})
170170
```
171171

172172
```python
173-
Template().from_registry(
173+
Template().from_image(
174174
image="ubuntu:22.04",
175175
username="user",
176176
password="pass",

template/customization/defining-template.mdx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ Copy files from your local filesystem to the template:
6868
// Copy a single file
6969
template.copy("package.json", "/app/package.json");
7070

71-
// Copy multiple files
72-
template.copy([
71+
// Copy multiple files to same destination
72+
template.copy(["file1", "file2"], "/app/file")
73+
74+
// Copy multiple files using copyItems
75+
template.copyItems([
7376
{ src: "src/", dest: "/app/src/" },
7477
{ src: "package.json", dest: "/app/package.json" },
7578
]);
@@ -85,8 +88,11 @@ template.copy("config.json", "/app/config.json", {
8588
# Copy a single file
8689
template.copy("package.json", "/app/package.json")
8790

88-
# Copy multiple files
89-
template.copy([
91+
# Copy multiple files to same destination
92+
template.copy(["file1", "file2"], "/app/file")
93+
94+
# Copy multiple files using copy_items
95+
template.copy_items([
9096
{"src": "src/", "dest": "/app/src/"},
9197
{"src": "package.json", "dest": "/app/package.json"},
9298
])
@@ -185,24 +191,30 @@ Clone Git repositories during template build (requires `git` to be installed):
185191

186192
```typescript
187193
// Clone a repository
194+
template.gitClone('https://github.com/user/repo.git')
195+
196+
// Clone a repository to a specific path
188197
template.gitClone('https://github.com/user/repo.git', '/app/repo')
189198

190199
// Clone a specific branch
191200
template.gitClone('https://github.com/user/repo.git', '/app/repo', {
192201
branch: 'main',
193202
})
194203

195-
// Clone with depth limit
204+
// Shallow clone with depth limit
196205
template.gitClone('https://github.com/user/repo.git', '/app/repo', {
197206
depth: 1,
198207
})
199208
```
200209

201210
```python
202-
# Basic clone
211+
# Clone a repository
212+
template.git_clone("https://github.com/user/repo.git")
213+
214+
# Clone a repository to a specific path
203215
template.git_clone("https://github.com/user/repo.git", "/app/repo")
204216

205-
# Clone specific branch
217+
# Clone a specific branch
206218
template.git_clone("https://github.com/user/repo.git", "/app/repo", branch="main")
207219

208220
# Shallow clone with depth limit

0 commit comments

Comments
 (0)