Skip to content

Instantly share code, notes, and snippets.

@julz
Created September 15, 2015 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julz/b1c7ee9c82f0bc3044d0 to your computer and use it in GitHub Desktop.
Save julz/b1c7ee9c82f0bc3044d0 to your computer and use it in GitHub Desktop.

Standard Operations

The following operations should be supported by all runtimes. A container runtime supports an operation by invoking ‘[binary name] [operation name]’.

The following examples use ‘funC’ as the runtime, an alternate runtime can be used by substituting its name where funC appears.

Standard Flags

All operations should support the following flags:

  • log: Redirects logs to the given file
  • logLevel: Sets the log level
  • id: The ID of the container. Defaults to the current directory if not specified.

Operations

Start

~~~~
funC start [bundlePath] [-id id]
~~~~

Starts the container described by the bundle. The ID of the container will be the directory name of the container.

Flags:

  • Standard Flags

Example:

  • funC start /path/to/bundle -id 1234-abc-def

Exit codes:

  • Exits with the exit code of the underlying process

Exec

~~~~
funC exec [-id id]
~~~~

Runs a secondary process in the given container.

Arguments:

  • processJson - a json encoded according to the definition of specs.Process

Flags:

  • Standard Flags, plus:
  • —start: starts the container if neccessary

Example:

  • funC exec

Exit codes:

  • Exits with the exit code of the underlying process

Pause

~~~~
funC pause [-id id]
~~~~

Pauses the container, which temporarily ceases execution of all processes (but allows them to later be Resumed).

Flags:

  • Standard Flags

Example:

  • funC pause

Exit code:

  • 0 on success, non-zero on error.

Signal

~~~~
funC signal [-id id] [-signal SIGNAL]
~~~~

Sends a signal to the container. Defaults to SIG_KILL. The Signal must be one of the valid posix signals.

Flags:

  • Standard Flags

Example:

  • funC signal -id 1234-abcd-5678 -signal KILL

Exit code:

  • 0 on success, non-zero on error. A 0 exit status does not imply the process has exited (as it may have caught the signal).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment