やりたいこと とあるプログラムを実行するDockerコンテナを毎日定刻に起動したい。 処理が完了したらコンテナは消去したい。 つまり、次のコマンドをcronで実行したい。 $ docker run -it --rm my_image my_command やったこと crontabにそのまま書けばいいじゃん! と思ったが、そうは東京医科歯科大学。 $ crontab -e 0 7 * * * docker run -it --rm my_image my_command 定刻になっても、うんともすんともしない。 まずは、crontabの実行環境で、dockerコマンドにパスが通ってんのかが気になった。 $ which docker /usr/bin/docker $ crontab -e * * * * * echo $PATH > /tmp/env.txt 結果は、 $ cat /tmp