我如何从正在等待Ctrl-C(或另一个键)的容器中分离?

我想在一个Docker容器中启动Azure函数运行时

docker run -p 8080:8080 -d --hostname functions-container --name functions-container functions-container 

但是当容器启动时,运行时会等待Ctrl-C,并且容器不会分离 – 在后台运行。

 Step 13/13 : RUN func host start -p 8080 ---> Running in 2eb979b60ab8 %%%%%% %%%%%% @ %%%%%% @ @@ %%%%%% @@ @@@ %%%%%%%%%%% @@@ @@ %%%%%%%%%% @@ @@ %%%% @@ @@ %%% @@ @@ %% @@ %% % [10/5/2017 5:41:03 AM] Reading host configuration file 'C:\App\publish\host.json' [10/5/2017 5:41:03 AM] Host configuration file read: [10/5/2017 5:41:03 AM] { [10/5/2017 5:41:03 AM] } [10/5/2017 5:41:04 AM] Generating 1 job function(s) [10/5/2017 5:41:04 AM] Starting Host (HostId=2eb979b60ab8-799971834, Version=2.0.11308.0, ProcessId=7920, Debug=False, Attempt=0) [10/5/2017 5:41:04 AM] Found the following functions: [10/5/2017 5:41:04 AM] Host.Functions.HttpTriggerCSharp [10/5/2017 5:41:04 AM] [10/5/2017 5:41:04 AM] Job host started Listening on http://localhost:8080/ Hit CTRL-C to exit... Http Functions: HttpTriggerCSharp: http://localhost:8080/api/HttpTriggerCSharp 

有没有办法强制分离或以其他方式在后台运行?

Interesting Posts