Configure foundry container

This commit is contained in:
2023-03-08 22:22:43 -07:00
parent d9a7ea19a3
commit b708bb2122
4 changed files with 23 additions and 17 deletions
+5 -2
View File
@@ -22,7 +22,7 @@ import sys
from dataclasses import dataclass
from decouple import config
import subprocess
from python_on_whales import DockerClient
from python_on_whales import DockerClient, DockerException
import click
import importlib.resources
from pathlib import Path
@@ -83,7 +83,10 @@ def command(ctx, include, exclude, cluster, command, extra_args):
container_exec_env = _make_runtime_env(ctx.obj)
if verbose:
print(f"Running compose exec {service_name} {command_to_exec}")
docker.compose.execute(service_name, command_to_exec, envs=container_exec_env)
try:
docker.compose.execute(service_name, command_to_exec, envs=container_exec_env)
except DockerException as error:
print(f"container command returned error exit status")
elif command == "port":
if extra_args_list is None or len(extra_args_list) < 2:
print("Usage: port <service> <exposed-port>")