-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tedi/githubdocs
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
docs/docs/api-reference/starlark-reference/image-build-spec.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: Image Build Spec | ||
sidebar_label: Image Build Spec | ||
--- | ||
|
||
Kurtosis starts services based on a provided image definition in the `image` arg of [`ServiceConfig`](./service-config.md). You can provide Kurtosis with a published image to use or alternatively, use `ImageBuildSpec` to instruct Kurtosis to build the Docker image the service will be started from. | ||
|
||
`ImageBuildSpec` can be especially useful when developing on a service that needs to be run in an enclave over and over to test latest changes. Kurtosis leverages the Docker's image caching when building images so images aren't rebuilt everytime. | ||
|
||
```python | ||
image = ImageBuildSpec( | ||
# Name to give built image | ||
# MANDATORY | ||
image_name="kurtosistech/example-datastore-server" | ||
|
||
# Locator to build context within the Kurtosis package | ||
# As of now, Kurtosis expects a Dockerfile at the root of the build context | ||
# MANDATORY | ||
build_context_dir="./server" | ||
|
||
# Stage of image build to target for multi-stage container image | ||
# OPTIONAL | ||
target_stage="" | ||
) | ||
``` | ||
:::info | ||
Note that `ImageBuildSpec` can only be used in packages and not standalone scripts as it relies on the build context being in the package. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters