Pass uid and gid to compose

Former-commit-id: cea4e5a51f
This commit is contained in:
David Boreham 2023-02-28 10:22:27 -07:00
parent c6de6d6067
commit 70d34e6751

View File

@ -76,8 +76,10 @@ def command(ctx, include, exclude, cluster, command, extra_args):
service_name = extra_args_list[0] service_name = extra_args_list[0]
command_to_exec = extra_args_list[1:] command_to_exec = extra_args_list[1:]
container_exec_env = { container_exec_env = {
"CERC_SCRIPT_DEBUG": "true" "CERC_HOST_UID": f"{os.getuid()}",
} if debug else {} "CERC_HOST_GID": f"{os.getgid()}"
}
container_exec_env.update({"CERC_SCRIPT_DEBUG": "true"} if debug else {})
if verbose: if verbose:
print(f"Running compose exec {service_name} {command_to_exec}") print(f"Running compose exec {service_name} {command_to_exec}")
docker.compose.execute(service_name, command_to_exec, envs=container_exec_env) docker.compose.execute(service_name, command_to_exec, envs=container_exec_env)