Help us understand the problem. What is going on with this article?

[メモ]Docker コンテナで定期的に任意のコマンドを実行する

More than 1 year has passed since last update.

例えば以下のように書けば date コマンドを10秒ごとに実行する

$docker run -d alpine /bin/sh -c "while :; do sleep 10; date; done"
a7758deaa636b2910696d940d1c30281e3e5ddb4e973c7a8749081ba724940cf

$docker logs a7758deaa636b2910696d940d1c30281e3e5ddb4e973c7a8749081ba724940cf
Sat Nov  9 20:07:39 UTC 2019

while do done で無限ループさせている

toshihirock
こちらは個人の意見で会社とは関係ありません。お約束です。
http://toshihirock.blogspot.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away