Skip to content

Commit

Permalink
runtime: Move start's --id to a positional parameter
Browse files Browse the repository at this point in the history
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 <wking@tremily.us>
  • Loading branch information
wking committed Feb 9, 2017
1 parent 6375ad0 commit 3d50871
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ For example, POSIX systems define [`LANG` and related environment variables][pos

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

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

```
# in a bundle directory with a process that echos "hello" and exits 42
$ funC start --id hello-1
$ funC start hello-1
hello
$ echo $?
Expand All @@ -74,7 +74,7 @@ Request the container state.

```
# in a bundle directory with a process that sleeps for several seconds
$ funC start --id sleeper-1 &
$ funC start sleeper-1 &
$ funC state sleeper-1
{
"ociVersion": "1.0.0-rc1",
Expand Down Expand Up @@ -114,7 +114,7 @@ $ echo $?

```
# in a bundle directory with a process ignores TERM
$ funC start --id sleeper-1 &
$ funC start sleeper-1 &
$ funC kill sleeper-1
$ echo $?
0
Expand Down

0 comments on commit 3d50871

Please sign in to comment.