# createFile

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `13.6.5`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/b33d222049f1ecc3bc7257ec07b622fe550b2580)

Creates a container file entry with inline contents or a host source path.

## Definition

```typescript
interface ContainerFileSystemCallbackContext {
  // ... omitted for brevity
  createFile(
    name: string,
    contents?: string,
    sourcePath?: string,
    owner?: number,
    group?: number,
    mode?: number,
    continueOnError?: boolean): ContainerFileSystemItem
}
```

## Parameters

- `name` (`string`)
- `contents` (`string`) `optional`
- `sourcePath` (`string`) `optional`
- `owner` (`number`) `optional`
- `group` (`number`) `optional`
- `mode` (`number`) `optional`
- `continueOnError` (`boolean`) `optional`

## Returns

[ContainerFileSystemItem](/reference/api/typescript/aspire.hosting/containerfilesystemitem.md)

## Applies to

- [ContainerFileSystemCallbackContext](/reference/api/typescript/aspire.hosting/containerfilesystemcallbackcontext.md)
