Skip to content

Commit 7a19003

Browse files
authored
fix(doc): updated doc for create and start a container (#531)
1 parent b9463ef commit 7a19003

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

README.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,31 @@ await client.Images.CreateImageAsync(
105105
new Progress<JSONMessage>());
106106
```
107107

108+
109+
#### Example: Create a container
110+
111+
The following code will create a new container of the previously fetched image.
112+
113+
```csharp
114+
await client.Containers.CreateContainerAsync(new CreateContainerParameters()
115+
{
116+
Image = "fedora/memcached",
117+
HostConfig = new HostConfig()
118+
{
119+
DNS = new[] { "8.8.8.8", "8.8.4.4" }
120+
}
121+
});
122+
```
123+
108124
#### Example: Start a container
109125

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

112128
```csharp
113129
await client.Containers.StartContainerAsync(
114130
"39e3317fd258",
115-
new HostConfig
116-
{
117-
DNS = new[] { "8.8.8.8", "8.8.4.4" }
118-
});
131+
new ContainerStartParameters()
132+
);
119133
```
120134

121135
#### Example: Stop a container

0 commit comments

Comments
 (0)