Skip to content

Commit 88062a0

Browse files
committed
runtime: Move start's --id to a positional parameter
I added this as an option in 5033c59 (Add an --id option to 'start', 2015-09-15), because some callers might want to leave ID generation to the runtime. When there is a long-running host process waiting on the container process to perform cleanup, the runtime-caller may not need to know the container ID. However, runC has been requiring a user-specified ID since [1], and the coming create/start split will follow the early-exit 'create' from [2], so require an ID here. We can revisit this if we regain a long-running 'create' process. You can create a config that adds no isolation vs. the runtime namespace or completely joins another set of existing namespaces. It seems odd to call that a new "container", but the ID is really more of a process ID, and less of a container ID. The "container" phrasing is just a useful hint that there might be some isolation going on. And we're always creating a new "container process" with 'start' (which will become 'create'). [1]: opencontainers/runc#541 opencontainers/runc@a7278cad (Require container id as arg1, 2016-02-08, opencontainers/runc#541) [2]: opencontainers/runc#827 Summary: Implement create and start Signed-off-by: W. Trevor King <[email protected]>
1 parent 35e2234 commit 88062a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

runtime.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ For example, POSIX systems define [`LANG` and related environment variables][pos
3737

3838
Start a container from a [bundle directory][bundle].
3939

40+
* *Arguments*
41+
* *`<ID>`* Set the container ID to create.
4042
* *Options*
41-
* *`--id <ID>`* Set the container ID when creating or joining a container.
42-
If not set, the runtime is free to pick any ID that is not already in use.
4343
* *`--bundle <PATH>`* Override the path to the [bundle directory][bundle] (defaults to the current working directory).
4444
* *Standard streams:* The runtime MUST attach its standard streams directly to the application process without inspection.
4545
* *Environment variables*
@@ -51,7 +51,7 @@ Start a container from a [bundle directory][bundle].
5151

5252
```
5353
# in a bundle directory with a process that echos "hello" and exits 42
54-
$ funC start --id hello-1
54+
$ funC start hello-1
5555
hello
5656
5757
$ echo $?
@@ -74,7 +74,7 @@ Request the container state.
7474

7575
```
7676
# in a bundle directory with a process that sleeps for several seconds
77-
$ funC start --id sleeper-1 &
77+
$ funC start sleeper-1 &
7878
$ funC state sleeper-1
7979
{
8080
"ociVersion": "1.0.0-rc1",
@@ -114,7 +114,7 @@ $ echo $?
114114

115115
```
116116
# in a bundle directory with a process ignores TERM
117-
$ funC start --id sleeper-1 &
117+
$ funC start sleeper-1 &
118118
$ funC kill sleeper-1
119119
$ echo $?
120120
0

0 commit comments

Comments
 (0)