Skip to content

Commit

Permalink
Refactored ServiceConfig docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mieubrisse committed Feb 26, 2024
1 parent 630f8ac commit 33ed7b3
Show file tree
Hide file tree
Showing 2 changed files with 175 additions and 243 deletions.
43 changes: 43 additions & 0 deletions docs/docs/api-reference/starlark-reference/image-spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: ImageSpec
sidebar_label: ImageSpec
---

The `ImageSpec` object constructor allows for providing detailed information about a container image for use in the [`ServiceConfig.image`](./service-config.md#image) property. It is most commonly used when pulling an image from a non-Dockerhub container repository.

Signature
---------

```
ImageSpec(
name,
registry = "http://hub.docker.com",
username = None,
password = None,
)
```

| Property | Description |
| --- | --- |
| **name**<br/>_string_ | The name of the container image that should be used. |
| **registry**<br/>_string_ | The registry that the container should be pulled from. |
| **username**<br/>_string_ | The username that will be used for connecting to the registry when pulling the image. |
| **password**<br/>_string_ | The password that will be used for connecting to the registry when pulling the image. |

Examples
--------
Starting a service called `my-service` from `my.registry.io` using a custom username and password:

```python
plan.add_service(
name = "my-service",
config = ServiceConfig(
image = ImageSpec(
name = "my.registry.io/some-org/some-image",
registry = "http://my.registry.io/",
username = "registry-user",
password = "SomePassword1!",
)
)
)
```
Loading

0 comments on commit 33ed7b3

Please sign in to comment.