Skip to content

Commit

Permalink
fix(doc): updated doc for create and start a container (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
mggrand authored Aug 31, 2021
1 parent b9463ef commit 7a19003
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,31 @@ await client.Images.CreateImageAsync(
new Progress<JSONMessage>());
```


#### Example: Create a container

The following code will create a new container of the previously fetched image.

```csharp
await client.Containers.CreateContainerAsync(new CreateContainerParameters()
{
Image = "fedora/memcached",
HostConfig = new HostConfig()
{
DNS = new[] { "8.8.8.8", "8.8.4.4" }
}
});
```

#### Example: Start a container

The following code will start the created container with specified `HostConfig` object. This object is optional, therefore you can pass a null.
The following code will start the created container.

```csharp
await client.Containers.StartContainerAsync(
"39e3317fd258",
new HostConfig
{
DNS = new[] { "8.8.8.8", "8.8.4.4" }
});
new ContainerStartParameters()
);
```

#### Example: Stop a container
Expand Down

0 comments on commit 7a19003

Please sign in to comment.