Skip to content

Commit 47a7388

Browse files
committed
docs(docker): Document image environment footgun
From [PR feedback](jmbannon#1321 (comment)).
1 parent 95f4afd commit 47a7388

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/source/guides/getting_started/automating.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ The container cron wrapper script will write output from the cron job to
3232
...`` that file so you can monitor the cron job in the container's output and thus also
3333
in the Docker logs.
3434

35+
You may also set the ``CRON_RUN_ON_START`` environment variable to ``true`` to have the
36+
image run your cron script whenever the container starts in addition to the cron
37+
schedule.
38+
39+
.. warning::
40+
41+
Using ``CRON_RUN_ON_START`` is not recommended because it may cause your cron script
42+
to run too often and may trigger throttles and bans. When enabled, your cron script
43+
will run *whenever* the container starts including when the host reboots, when ``#
44+
dockerd`` is upgraded, when a new image is pulled, when something applies Compose
45+
changes, etc.. This may result in running ``ytdl-sub`` right before or after the next
46+
cron scheduled run or even at the same time on top of each other. Instead, run your
47+
cron script manually inside the running container as needed:
48+
49+
.. code-block:: console
50+
51+
docker compose exec ytdl-sub bash /config/ytdl-sub-configs/cron
52+
3553
3654
.. _linux-setup:
3755

0 commit comments

Comments
 (0)