# ContainerFileSystemCallbackContext

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

Represents the context for a `ContainerFileSystemCallbackAnnotation` callback.

## Definition

```typescript
interface ContainerFileSystemCallbackContext {
  readonly model: IResource;
  readonly services: IServiceProvider;
  createCertificateFile(
      name: string,
      contents?: string,
      sourcePath?: string,
      owner?: number,
      group?: number,
      mode?: number,
      continueOnError?: boolean): ContainerFileSystemItem;
  createDirectory(
      name: string,
      entries: ContainerFileSystemItem[],
      owner?: number,
      group?: number,
      mode?: number): ContainerFileSystemItem;
  createFile(
      name: string,
      contents?: string,
      sourcePath?: string,
      owner?: number,
      group?: number,
      mode?: number,
      continueOnError?: boolean): ContainerFileSystemItem;
}
```

## Properties

- `model`: [IResource](/reference/api/typescript/aspire.hosting/iresource.md) `get` -- The app model resource the callback is associated with.
- `services`: `IServiceProvider` `get` -- A `IServiceProvider` that can be used to resolve services in the callback.

## Methods

- [createCertificateFile](/reference/api/typescript/aspire.hosting/containerfilesystemcallbackcontext/createcertificatefile.md) -- `method` -- Creates a PEM container certificate file entry with the OpenSSL subject-hash symlink.
    ```typescript
  createCertificateFile(name: string, contents?: string, sourcePath?: string, owner?: number, group?: number, mode?: number, continueOnError?: boolean): ContainerFileSystemItem
  ```
- [createDirectory](/reference/api/typescript/aspire.hosting/containerfilesystemcallbackcontext/createdirectory.md) -- `method` -- Creates a container directory entry containing the specified child entries.
    ```typescript
  createDirectory(name: string, entries: ContainerFileSystemItem[], owner?: number, group?: number, mode?: number): ContainerFileSystemItem
  ```
- [createFile](/reference/api/typescript/aspire.hosting/containerfilesystemcallbackcontext/createfile.md) -- `method` -- Creates a container file entry with inline contents or a host source path.
    ```typescript
  createFile(name: string, contents?: string, sourcePath?: string, owner?: number, group?: number, mode?: number, continueOnError?: boolean): ContainerFileSystemItem
  ```
