Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Commands for the docker container runtime

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "docker container runtime commands", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "docker container runtime commands" it!

What is the docker container runtime command? To keep the docker container running and execute the running command in a timely manner, you can put the command to be executed into the script and set the script as the command to run when Docker starts the container:

FROM sixeyed / ubuntu-with-utilsRUN echo'ping localhost&' > / bootstrap.shRUN echo'sleep infinity' > > / bootstrap.shRUN chmod + x / bootstrap.shCMD / bootstrap.sh

Build an image from this Dockerfile and run a container starting from the image, it will start the ping background and sleep in the foreground, so you can use the docker run-d daemon assembly, and it will continue to run.

But this is not ideal. Docker only monitors the last process running the container, so it will check sleep code > instead of ping. If the ping command is incorrect, the container will continue to run. Often, users want the real application to be the only tool they start with in CMD.

At this point, I believe you have a deeper understanding of "docker container runtime commands". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report