Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
281 views
in Technique[技术] by (71.8m points)

Is there a way to have a docker container wait for an external call?

I have looked for a bit on Stack Overflow for a way to have a container start up and wait for an external connection but have not seen anything.

Here is what my process looks like currently:

  1. Non-Docker external process reaches out at X interval and tells system to run a command.
  2. Command runs.
  3. System should remain idle until the next interval.

Now I have seen a few options with --wait or sleep but I would think that would not allow the container to receive the connection.

I also looked at the wait for container script that is often recommended but in this case I need the container to wait for a script to call it on non defined intervals.

I have tried having this just run the help command for my process but it then fails the container after a bit of time and makes it a mess for finding anything. Additionally I have tried to have the container start with no command just to run the base OS and wait for the call but that did not work either.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I was looking at this wrong. Ended up just running like any other webserver and database server.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...