Common resources for LXC and systemd-nspawn containers
New in version 2015.8.0.
These functions are not designed to be called directly, but instead from the
lxc
, nspawn
, and
docker
execution modules. They provide for
common logic to be re-used for common actions.
salt.modules.container_resource.
cache_file
(source)¶Wrapper for cp.cache_file which raises an error if the file was unable to be cached.
CLI Example:
salt myminion container_resource.cache_file salt://foo/bar/baz.txt
salt.modules.container_resource.
copy_to
(name, source, dest, container_type=None, path=None, exec_driver=None, overwrite=False, makedirs=False)¶Common logic for copying files to containers
path to the container parent (for LXC only) default: /var/lib/lxc (system default)
CLI Example:
salt myminion container_resource.copy_to mycontainer /local/file/path /container/file/path container_type=docker exec_driver=nsenter
salt.modules.container_resource.
run
(name, cmd, container_type=None, exec_driver=None, output=None, no_start=False, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, path=None, use_vt=False, keep_env=None)¶Common logic for running shell commands in containers
path to the container parent (for LXC only) default: /var/lib/lxc (system default)
CLI Example:
salt myminion container_resource.run mycontainer 'ps aux' container_type=docker exec_driver=nsenter output=stdout
Generated on November 29, 2023 at 04:05:44 UTC.
You are viewing docs for the latest stable release, 3006.4. Switch to docs for the previous stable release, 3005.4, or to a recent doc build from the master branch.
© 2023 VMware, Inc. | Privacy Policy