Skip to content

Commit b2542f1

Browse files
pouchrobotallencloud
authored andcommitted
docs: auto generate pouch cli docs via code
Signed-off-by: pouchrobot <[email protected]>
1 parent 221e842 commit b2542f1

File tree

2 files changed

+14
-106
lines changed

2 files changed

+14
-106
lines changed

docs/api/HTTP_API.md

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,48 +2327,17 @@ container stats almost from cgroup resource usage.
23272327

23282328
<a name="containerupgradeconfig"></a>
23292329
### ContainerUpgradeConfig
2330-
ContainerUpgradeConfig is used for API "POST /containers/upgrade".
2331-
It wraps all kinds of config used in container upgrade.
2332-
It can be used to encode client params in client and unmarshal request body in daemon side.
2333-
2334-
*Polymorphism* : Composition
2330+
ContainerUpgradeConfig is used for API "POST /containers/{name:.*}/upgrade". when upgrade a container,
2331+
we must specify new image used to create a new container, and also can specify `Cmd` and `Entrypoint` for
2332+
new container. There is all parameters that upgrade a container, if want to change other parameters, i
2333+
think you should use `update` API interface.
23352334

23362335

23372336
|Name|Description|Schema|
23382337
|---|---|---|
2339-
|**ArgsEscaped** <br>*optional*|Command is already escaped (Windows only)|boolean|
2340-
|**AttachStderr** <br>*optional*|Whether to attach to `stderr`. <br>**Default** : `true`|boolean|
2341-
|**AttachStdin** <br>*optional*|Whether to attach to `stdin`.|boolean|
2342-
|**AttachStdout** <br>*optional*|Whether to attach to `stdout`. <br>**Default** : `true`|boolean|
2343-
|**Cmd** <br>*optional*|Command to run specified an array of strings.|< string > array|
2344-
|**DisableNetworkFiles** <br>*optional*|Whether to generate the network files(/etc/hostname, /etc/hosts and /etc/resolv.conf) for container. <br>**Default** : `false`|boolean|
2345-
|**DiskQuota** <br>*optional*|Set disk quota for container.<br>Key is the dir in container.<br>Value is disk quota size for the dir.<br>/ means rootfs dir in container.<br>.* includes rootfs dir and all volume dir.|< string, string > map|
2346-
|**Domainname** <br>*optional*|The domain name to use for the container.|string|
2347-
|**Entrypoint** <br>*optional*|The entry point for the container as a string or an array of strings.<br>If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default.|< string > array|
2348-
|**Env** <br>*optional*|A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value.|< string > array|
2349-
|**ExposedPorts** <br>*optional*|An object mapping ports to an empty object in the form:`{<port>/<tcp\|udp>: {}}`|< string, object > map|
2350-
|**HostConfig** <br>*optional*||[HostConfig](#hostconfig)|
2351-
|**Hostname** <br>*optional*|The hostname to use for the container, as a valid RFC 1123 hostname. <br>**Minimum length** : `1`|string (hostname)|
2352-
|**Image** <br>*required*|The name of the image to use when creating the container|string|
2353-
|**InitScript** <br>*optional*|Initial script executed in container. The script will be executed before entrypoint or command|string|
2354-
|**Labels** <br>*optional*|User-defined key/value metadata.|< string, string > map|
2355-
|**MacAddress** <br>*optional*|MAC address of the container.|string|
2356-
|**NetPriority** <br>*optional*|net priority.|integer|
2357-
|**NetworkDisabled** <br>*optional*|Disable networking for the container.|boolean|
2358-
|**OnBuild** <br>*optional*|`ONBUILD` metadata that were defined.|< string > array|
2359-
|**OpenStdin** <br>*optional*|Open `stdin`|boolean|
2360-
|**QuotaID** <br>*optional*|Set disk quota by specified quota id. <br>If QuotaID <= 0, it means pouchd should allocate a unique quota id by sequence automatically.<br>By default, a quota ID is mapped to only one container. And one quota ID can include several mountpoint.|string|
2361-
|**Rich** <br>*optional*|Whether to start container in rich container mode. (default false)|boolean|
2362-
|**RichMode** <br>*optional*|Choose one rich container mode.(default dumb-init)|enum (dumb-init, sbin-init, systemd)|
2363-
|**Shell** <br>*optional*|Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.|< string > array|
2364-
|**SpecAnnotation** <br>*optional*|annotations send to runtime spec.|< string, string > map|
2365-
|**StdinOnce** <br>*optional*|Close `stdin` after one attached client disconnects|boolean|
2366-
|**StopSignal** <br>*optional*|Signal to stop a container as a string or unsigned integer. <br>**Default** : `"SIGTERM"`|string|
2367-
|**StopTimeout** <br>*optional*|Timeout to stop a container in seconds.|integer|
2368-
|**Tty** <br>*optional*|Attach standard streams to a TTY, including `stdin` if it is not closed.|boolean|
2369-
|**User** <br>*optional*|The user that commands are run as inside the container.|string|
2370-
|**Volumes** <br>*optional*|An object mapping mount point paths inside the container to empty objects.|< string, object > map|
2371-
|**WorkingDir** <br>*optional*|The working directory for commands to run in.|string|
2338+
|**Cmd** <br>*optional*|Execution commands and args|< string > array|
2339+
|**Entrypoint** <br>*optional*|The entrypoint for the container as a string or an array of strings.<br>If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default.|< string > array|
2340+
|**Image** <br>*required*||string|
23722341

23732342

23742343
<a name="daemonupdateconfig"></a>

docs/commandline/pouch_upgrade.md

Lines changed: 7 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,88 +4,27 @@ Upgrade a container with new image and args
44

55
### Synopsis
66

7-
Upgrade a container with new image and args
7+
upgrade is a feature to replace a container's image.You can specify the new Entrypoint and Cmd for the new container. When you want to updatea container's image, but inherit the network and volumes of the old container, then you shouldthink about the upgrade feature.
88

99
```
10-
pouch upgrade [OPTIONS] IMAGE [COMMAND] [ARG...]
10+
pouch upgrade [OPTIONS] CONTAINER [COMMAND] [ARG...]
1111
```
1212

1313
### Examples
1414

1515
```
16-
$ pouch run -d -m 20m --name test1 registry.hub.docker.com/library/busybox:latest
16+
$ pouch run -d -m 20m --name test registry.hub.docker.com/library/busybox:latest
1717
4c58d27f58d38776dda31c01c897bbf554c802a9b80ae4dc20be1337f8a969f2
18-
$ pouch upgrade --name test1 registry.hub.docker.com/library/hello-world:latest
18+
$ pouch upgrade --image registry.hub.docker.com/library/hello-world:latest test
1919
test1
2020
```
2121

2222
### Options
2323

2424
```
25-
--annotation strings Additional annotation for runtime
26-
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable
27-
--blkio-weight-device value Block IO weight (relative device weight), need CFQ IO Scheduler enable (default [])
28-
--cap-add strings Add Linux capabilities
29-
--cap-drop strings Drop Linux capabilities
30-
--cgroup-parent string Optional parent cgroup for the container
31-
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period, range is in [1000(1ms),1000000(1s)]
32-
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota, range is in [1000,∞)
33-
--cpu-shares int CPU shares (relative weight)
34-
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
35-
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
36-
--device strings Add a host device to the container
37-
--device-read-bps value Limit read rate (bytes per second) from a device (default [])
38-
--device-read-iops value Limit read rate (IO per second) from a device (default [])
39-
--device-write-bps value Limit write rate (bytes per second) from a device (default [])
40-
--device-write-iops value Limit write rate (IO per second) from a device (default [])
41-
--disable-network-files Disable the generation of network files(/etc/hostname, /etc/hosts and /etc/resolv.conf) for container. If true, no network files will be generated. Default false
42-
--disk-quota strings Set disk quota for container
43-
--enableLxcfs Enable lxcfs for the container, only effective when enable-lxcfs switched on in Pouchd
44-
--entrypoint string Overwrite the default ENTRYPOINT of the image
45-
-e, --env stringArray Set environment variables for container
46-
--expose strings Set expose container's ports
47-
--group-add strings Add additional groups to join
48-
-h, --help help for upgrade
49-
--hostname string Set container's hostname
50-
--initscript string Initial script executed in container
51-
--intel-rdt-l3-cbm string Limit container resource for Intel RDT/CAT which introduced in Linux 4.10 kernel
52-
--ipc string IPC namespace to use
53-
-l, --label stringArray Set labels for a container
54-
--log-driver string Logging driver for the container (default "json-file")
55-
--log-opt stringArray Log driver options
56-
-m, --memory string Memory limit
57-
--memory-extra int Represent container's memory high water mark percentage, range in [0, 100]
58-
--memory-force-empty-ctl int Whether to reclaim page cache when deleting the cgroup of container
59-
--memory-swap string Swap limit equal to memory + swap, '-1' to enable unlimited swap
60-
--memory-swappiness int Container memory swappiness [0, 100]
61-
--memory-wmark-ratio int Represent this container's memory low water mark percentage, range in [0, 100]. The value of memory low water mark is memory.limit_in_bytes * MemoryWmarkRatio
62-
--name string Specify name of container
63-
--net strings Set networks to container
64-
--net-priority int net priority
65-
--nvidia-capabilities string NvidiaDriverCapabilities controls which driver libraries/binaries will be mounted inside the container
66-
--nvidia-visible-devs string NvidiaVisibleDevices controls which GPUs will be made accessible inside the container
67-
--oom-kill-disable Disable OOM Killer
68-
--oom-score-adj int Tune host's OOM preferences (-1000 to 1000) (default -500)
69-
--pid string PID namespace to use
70-
--pids-limit int Set container pids limit
71-
-p, --port strings Set container ports mapping
72-
--privileged Give extended privileges to the container
73-
--quota-id string Specified quota id, if id < 0, it means pouchd alloc a unique quota id
74-
--restart string Restart policy to apply when container exits
75-
--rich Start container in rich container mode. (default false)
76-
--rich-mode string Choose one rich container mode. dumb-init(default), systemd, sbin-init
77-
--runtime string OCI runtime to use for this container
78-
--sche-lat-switch int Whether to enable scheduler latency count in cpuacct
79-
--security-opt strings Security Options
80-
--shm-size string Size of /dev/shm, default value is 64MB
81-
--sysctl strings Sysctl options
82-
-t, --tty Allocate a pseudo-TTY
83-
--ulimit value Set container ulimit (default [])
84-
-u, --user string UID
85-
--uts string UTS namespace to use
86-
-v, --volume strings Bind mount volumes to container, format is: [source:]<destination>[:mode], [source] can be volume or host's path, <destination> is container's path, [mode] can be "ro/rw/dr/rr/z/Z/nocopy/private/rprivate/slave/rslave/shared/rshared"
87-
--volumes-from strings set volumes from other containers, format is <container>[:mode]
88-
-w, --workdir string Set the working directory in a container
25+
--entrypoint string Overwrite the default ENTRYPOINT of the image
26+
-h, --help help for upgrade
27+
--image string Specify image of the new container
8928
```
9029

9130
### Options inherited from parent commands

0 commit comments

Comments
 (0)