klee container update

Modify container properties.

Usage

$ klee container update [OPTIONS] CONTAINER [COMMAND]...

Refer to the options section for an overview of available OPTIONS for this command.

Description

The klee container update command updates a container’s configuration. You can use this command to modify container environment behaviour by changing jail parameters, or changing the container configuration such as default environment variables, user running the process, or the name of the container.

Changing the container configurations, such as the default user, requires a restart of the container for changes to take effect. However, many jail parameters can be modified on a running container as well. If one or more jail parameters cannot be modified and error will occur and a restart is required for the changes to take effect.

Please note

Modifying jail parameters on a running container can cause unpredictable behaviour for the applications running in the container. Use with care.

Connecting/disconnecting a container to networks can be done using the klee network subcommands.

For example uses of this command, refer to the examples section below.

Options

Name, shorthand Default Description
--name Assign a new name to the container
--user , -u Default user used when running commands in the container
--env , -e Set environment variables (e.g. --env FIRST=env --env SECOND=env)
--jailparam , -J Set jail parameters. Replace defaults (such as 'mount.devfs', 'exec.clean', etc.) by specifying alternative values. See docs for details.
--persist , -P Do not remove this container when pruning
--restart Restarting policy of the container. Set to 'no' for no automatic restart of the container. Set to 'on-startup' to start the container each time Kleened is. [default: no]
--help Show this message and exit.

Examples

Update user and environment variables (--user/--env)

Updating the user and environment variables of my-container:

$ klee container update --user myuser --env VAR1=1 --env VAR2=2 my-container
ad813478a0ec

Update a container’s jail parameters (--jailparam)

Updating the jail parameters of the running container my-container:

$ klee container update -J mount.devfs -J allow.raw_sockets my-container
ad813478a0ec

Note that not all parameters can be updated while the container is running:

$ klee container update -J mount.devfs -J vnet my-container
an error ocurred while updating the container: '/usr/sbin/jail' returned non-zero exitcode 139 when attempting to modify the container ''

When an error occurs the container needs to be restarted for the changes to take effect.

Parent command

Command Description
klee container Manage containers