Home Explore Blog CI



docker

1st chunk of `content/reference/api/extensions-sdk/DockerDesktopClient.md`
f6b181e2db11217712dec3cf5d597893dac1e5ef220d4fd50000000100000fbd
---
title: "Interface: DockerDesktopClient"
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
aliases:
 - /desktop/extensions-sdk/dev/api/reference/interfaces/DockerDesktopClient/
 - /extensions/extensions-sdk/dev/api/reference/interfaces/DockerDesktopClient/
---

An amalgam of the v0 and v1 interfaces of the Docker Desktop API client,
provided for backwards compatibility reasons. Unless you're working with
a legacy extension, use the v1 type instead.

## Properties

### backend

• `Readonly` **backend**: `undefined` \| [`BackendV0`](BackendV0.md)

The `window.ddClient.backend` object can be used to communicate with the backend defined in the vm section of
the extension metadata.
The client is already connected to the backend.

> [!WARNING]
>
> It will be removed in a future version. Use [extension](DockerDesktopClient.md#extension) instead.

#### Inherited from

DockerDesktopClientV0.backend

___

### extension

• `Readonly` **extension**: [`Extension`](Extension.md)

The `ddClient.extension` object can be used to communicate with the backend defined in the vm section of the
extension metadata.
The client is already connected to the backend.

#### Inherited from

DockerDesktopClientV1.extension

___

### desktopUI

• `Readonly` **desktopUI**: [`DesktopUI`](DesktopUI.md)

#### Inherited from

DockerDesktopClientV1.desktopUI

___

### host

• `Readonly` **host**: [`Host`](Host.md)

#### Inherited from

DockerDesktopClientV1.host

___

### docker

• `Readonly` **docker**: [`Docker`](Docker.md)

#### Inherited from

DockerDesktopClientV1.docker

## Container Methods

### listContainers

▸ **listContainers**(`options`): `Promise`<`unknown`\>

Get the list of running containers (same as `docker ps`).

By default, this will not list stopped containers.
You can use the option `{"all": true}` to list all the running and stopped containers.

```typescript
const containers = await window.ddClient.listContainers();
```

> [!WARNING]
>
> It will be removed in a future version. Use [listContainers](Docker.md#listcontainers) instead.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `options` | `never` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.41/#operation/ContainerList). |

#### Returns

`Promise`<`unknown`\>

#### Inherited from

DockerDesktopClientV0.listContainers

___

## Image Methods

### listImages

▸ **listImages**(`options`): `Promise`<`unknown`\>

Get the list of images

```typescript
const images = await window.ddClient.listImages();
```

> [!WARNING]
>
> It will be removed in a future version. Use [listImages](Docker.md#listimages) instead.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `options` | `never` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.41/#tag/Image). |

#### Returns

`Promise`<`unknown`\>

#### Inherited from

DockerDesktopClientV0.listImages

___

## Navigation Methods

### navigateToContainers

▸ **navigateToContainers**(): `void`

Navigate to the container's window in Docker Desktop.
```typescript
window.ddClient.navigateToContainers();
```

> [!WARNING]
>
> It will be removed in a future version. Use [viewContainers](NavigationIntents.md#viewcontainers) instead.

#### Returns

`void`

#### Inherited from

DockerDesktopClientV0.navigateToContainers

___

### navigateToContainer

▸ **navigateToContainer**(`id`): `Promise`<`any`\>

Navigate to the container window in Docker Desktop.
```typescript
await window.ddClient.navigateToContainer(id);
```

> [!WARNING]
>
> It will be removed in a future version.

Title: DockerDesktopClient Interface: A Combined API Client for Docker Desktop
Summary
The `DockerDesktopClient` interface combines v0 and v1 versions of the Docker Desktop API client for backwards compatibility. It includes properties for accessing backend services, extensions, desktop UI, host, and Docker functionalities. It also provides methods for listing containers and images, and navigating to specific containers within the Docker Desktop UI, although some methods are marked for removal in future versions.