File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff 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
113129await 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
You can’t perform that action at this time.
0 commit comments