[lxc-devel] [pylxd/master] Update containers.rst

ajkavanagh on Github lxc-bot at linuxcontainers.org
Mon Feb 17 15:41:07 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 511 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200217/83bb5389/attachment.bin>
-------------- next part --------------
From 6be9a5d4e7881b94fe0c830e0234daf49bb19d21 Mon Sep 17 00:00:00 2001
From: ilyakimavets <il.yakimavets at gmail.com>
Date: Mon, 2 Apr 2018 16:18:12 +0300
Subject: [PATCH] Update containers.rst

---
 doc/source/containers.rst | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/doc/source/containers.rst b/doc/source/containers.rst
index bad8f4ed..3ab99fc3 100644
--- a/doc/source/containers.rst
+++ b/doc/source/containers.rst
@@ -112,34 +112,35 @@ you'll pass `wait=True` as well.
 
 If you were to use an actual image source, you would be able to operate
 on the container, starting, stopping, snapshotting, and deleting the
-container.
+container. You can also modify container config (limits and etc).
 
 .. code-block:: python
 
-    >>> config = {'name': 'my-container', 'source': {'type': 'image', 'alias': 'ubuntu/trusty'}}
+    >>> config = {'name': 'my-container', 'source': {'type': 'image', 'alias': 'ubuntu/trusty'} 'config': {'limits.cpu': '2'}}
     >>> container = client.containers.create(config, wait=True)
     >>> container.start()
     >>> container.freeze()
     >>> container.delete()
-   
-   
+
+
 Config line with a specific image source and a profile.
 
 .. code-block:: python
 
     >>> config = {'name': 'my-container', 'source': {'type': 'image', "mode": "pull", "server":
         "https://cloud-images.ubuntu.com/daily", "protocol": "simplestreams", 'alias': 'bionic/amd64'},
-	'profiles': ['profilename'] }
+        'profiles': ['profilename'] }
 
 
-To modify container's configuration method `save` should be called after
+To modify container's configuration method `
+` should be called after
 :class:`~container.Container` attributes changes.
 
     >>> container = client.containers.get('my-container')
     >>> container.ephemeral = False
     >>> container.devices = { 'root': { 'path': '/', 'type': 'disk', 'size': '7GB'} }
-    >>> container.save
-    
+    >>> container.save()
+
 To get state information such as a network address.
 
 .. code-block:: python


More information about the lxc-devel mailing list