Skip to content

Commit

Permalink
Merge branch 'main' into tedi/githubdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 authored Feb 20, 2024
2 parents 57d1c33 + 82f0d55 commit 29045ab
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions docs/docs/api-reference/starlark-reference/image-build-spec.md
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.
:::
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ config = ServiceConfig(
}
)
```
Note that `ImageBuildSpec` can only be used in packages and not standalone scripts as it relies on build context in package.
Note that `ImageBuildSpec` can only be used in packages and not standalone scripts as it relies on build context in package. More info on [`ImageBuildSpec`](./image-build-spec.md) here.
More info can be found on [locators referring to local resources here][locators] and how to turn your script into a Kurtosis [package][package] here.

The `ports` dictionary argument accepts a key value pair, where `key` is a user defined unique port identifier and `value` is a [PortSpec][port-spec] object.
Expand Down

0 comments on commit 29045ab

Please sign in to comment.