@docker_app.command(context_settings={"allow_extra_args":True,"ignore_unknown_options":True},help="Run a Docker container for the FastAgency app",)defrun(image:Annotated[str,typer.Argument(...,help="The Docker image to run",),]="deploy_fastagency",*,name:Annotated[str,typer.Option("--name",help="Assign a name to the container",),]="deploy_fastagency",env:Annotated[Optional[list[str]],typer.Option("--env","-e",help="Set environment variables",show_default=False,),]=None,publish:Annotated[Optional[list[str]],typer.Option("--publish","-p",help="Publish a container's port(s) to the host",show_default=False,),]=None,remove:Annotated[bool,typer.Option("--rm",help="Automatically remove the container and its associated anonymous volumes when it exits",is_flag=True,),]=False,detach:Annotated[bool,typer.Option("--detach","-d",help="Run container in background and print container ID",is_flag=True,),]=True,network:Annotated[Optional[str],typer.Option("--network",help="Connect a container to a network",show_default=False,),]=None,ctx:typer.Context,)->None:# Construct the docker run command using the provided optionscommand=["docker","run","--name",name]ifenv:forenv_varinenv:command.extend(["--env",env_var])ifpublish:forportinpublish:command.extend(["--publish",port])if"8888:8888"notinpublish:command.extend(["--publish","8888:8888"])else:command.extend(["--publish","8888:8888"])ifremove:command.append("--rm")ifdetach:command.append("--detach")ifnetwork:command.extend(["--network",network])command+=ctx.argscommand.append(image)try:typer.echo(f"Running FastAgency Docker image with the command: {' '.join(command)}")# Run the docker commandresult=subprocess.run(# nosec B603command,check=True,capture_output=True,text=True)typer.echo(result.stdout)exceptsubprocess.CalledProcessErrorase:typer.echo(f"Error: {e.stderr}",err=True)raisetyper.Exit(code=1)frome