# ProjectResource.PublishAsDockerFile

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [ProjectResource](/reference/api/go/aspire.hosting/projectresource.md)
- Version: `17.0.0`
- Kind: `method`

Publishes a project as a Docker file with optional container configuration

## Remarks

When the executable resource is converted to a container resource, the arguments to the executable
are not used. This is because arguments to the project often contain physical paths that are not valid
in the container. The container can be set up with the correct arguments using the `configure` action.

## Definition

```go
type ProjectResource interface {
    // ... omitted for brevity
    PublishAsDockerFile(options ...*PublishAsDockerFileOptions) ProjectResource
}
```

## Signature

```go
PublishAsDockerFile(options ...*PublishAsDockerFileOptions) ProjectResource
```

## Parameters

- `options` (`...*PublishAsDockerFileOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*PublishAsDockerFileOptions` argument.

- `Configure` (`func(obj ContainerResource)`) `callback` -- Optional action to configure the container resource

## Returns

[`ProjectResource`](/reference/api/go/aspire.hosting/projectresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [ProjectResource](/reference/api/go/aspire.hosting/projectresource.md) -- `handle`
