Skip to content

Commit

Permalink
docs: Update API docs for TypeScript SDK improvements (dagger#9115)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikram-dagger authored Dec 11, 2024
1 parent 10a23b5 commit ba70be4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/current_docs/api/module-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ This can be useful to add a few requirements to the module's execution environme
</TabItem>
<TabItem value="TypeScript">

The runtime container is currently hardcoded to run in Node.js 21.3 (although this may be configurable in future).
The runtime container is currently hardcoded to run in Node.js 22.11.0, but it can be overridden by [setting an alternative base image](../configuration/modules.mdx#alternative-base-images).

[Bun](https://bun.sh/) is experimentally supported and [work is in progress](https://github.com/dagger/dagger/issues/4368) to support [Deno](https://deno.com/).

Expand Down
22 changes: 22 additions & 0 deletions docs/current_docs/configuration/modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,25 @@ When a package manager is not explicitly defined within the `package.json` file,
:::warning
This behavior however should be considered a sensible fallback, and not as an explicit configuration. Since this default can change, we encourage you to configure a package manager explicitly.
:::

### Alternative base images

The image to use is derived from the version in the `dagger.runtime` field if it's present. If this is not suitable for your needs, you can specify a custom base image in your module's `package.json`, tailoring the SDK to your project's needs.

:::warning
It is recommended to use this feature only for advanced use cases such as adding bespoke environment variables, authentication files or operating system packages to the runtime container. Ensure that you avoid deviating from the default image too much, as doing so could create unexpected results.
:::

To change the base image, set the field `dagger.baseImage` in your Dagger module's `package.json` file.

```json
{
"dagger": {
"baseImage": "node:23.2.0-alpine@sha256:ecefaffd4706c5879af52e022fdb8ea30cbd6590e2a30d05347790d690727c6c"
}
}
```

:::note
Currently, only Alpine-based images are supported.
:::

0 comments on commit ba70be4

Please sign in to comment.