Package: cs.dockerutils
Docker related utilities.Latest release 20240201:mount_escape: strip trailing carriage return also.DockerRun: new output_map attribute much like input_map; also mount existing outputs within the container.Functiondefault_docker_command()pylint: disable=unnecessary-lambda-assignmentFunctiondefault_docker_compose_command()pylint: disable=unnecessary-lambda-assignmentFunctiondefault_docker_compose_config()pylint: disable=unnecessary-lambda-assignmentFunctiondocker(*dk_argv, exe=None, doit=True, quiet=True) -> subprocess.CompletedProcessInvokedockerwithdk_argv.Functiondocker_compose(*dc_argv, exe=None, config=None, doit=True, quiet=True) -> subprocess.CompletedProcessInvokedocker-composewithdc_argv.ClassDockerRunADockerRunspecifies how to prepare docker to execute a command.This is a generic wrapper for invoking a docker image and
internal executable to process data from the host system,
essentially a flexible and cleaned up version of the wrappers
used to invoke things like thelinuxserver:*utility docker
images.Input paths for the executable will be presented in a read
only directory, by default `/input' inside the container.An output directory (default '.', the current durectory) will
be mounted read/write inside the container, by default/outputinside the container.Unlikea lot of docker setups, the default mode runs as the
invoking user's UID/GID inside the container and expects thes6-setuidgidutility to be present in the image.See theffmpeg_dockerfunction fromcs.ffmpegutilsfor
an example invocation of this class.ClassDockerUtilCommand(cs.cmdutils.BaseCommand)A command line mode for working with Docker et al.Command line usage:Usage: dockerutil [options...] [@container] subcommand...
    -f docker-compose.yml
      Specify ['docker', 'compose'] YAML file.
      Default: 'docker-compose.yml', overridden by $DK_COMPOSE_YML
    @container  Specify a target container.

  Subcommands:
    help [-l] [subcommand-names...]
      Print the full help for the named subcommands,
      or for all subcommands if no names are specified.
      -l  Long help even if no subcommand-names provided.
    ps
      Show the running docker containers.
    run [options] image [command] [arg...]
      Invoke command in an instance of image.
      A read only directory for input data will be present as /input.
      A read/write directory for output data will be present at /output.
      The command's working directory will be /output.
      -i inputpath
          Mount inputpath as /input/basename(inputpath)
      --root
          Do not switch to the current effective uid:gid inside
          the container.
      -U  Update the local copy of image before running.
      Other options are passed to "docker run".
    shell
      Run a command prompt via cmd.Cmd using this command's subcommands.ClassDockerUtilCommandOptions(cs.cmdutils.BaseCommandOptions)Command line options forDockerUtilCommand.Functionmain(argv=None, **run_kw)Invoke theDockerUtilCommandwithargv.Functionmount_escape(*args) -> strEscape the strings inargsfor us in thedocker run --mountoption.Apparently the arguments todocker run --mountare in fact
a CSV data line.
(Of course you need to find this allusion in the bug tracker,
heaven forfend that the docs actually detail this kind of
thing.)Rather that try to enumerate what needs escaping, here we use
thecsvmodule to escape using the default "excel" dialect.Release LogRelease 20240201:mount_escape: strip trailing carriage return also.DockerRun: new output_map attribute much like input_map; also mount existing outputs within the container.Release 20231202:
Initial PyPI release.