backend icon indicating copy to clipboard operation
backend copied to clipboard

Cron to rebuild base Docker image

Open jtotoole opened this issue 3 years ago • 1 comments

At present, we sometimes find ourselves unable to build certain containers because our base image doesn't change much, and consequently isn't rebuilt very often. That means that the apt package links occasionally 404 as a result of old packages getting removed from the repository when new ones become available (additional context here).

One way to solve this problem would be to create a cron to rebuild the base image daily or weekly.

jtotoole avatar Mar 04 '21 16:03 jtotoole

Just to reiterate, this is "someday / nice to have" task.

Some notes:

  • GitHub Workflows support scheduled jobs: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events

  • We're supposedly limited to 2000 Action minutes/month but I think in our case they're effectively unlimited for some reason? Is this limit for private repos only?

  • Easy way to trigger the base image rebuild would be to print out the docker pull commands instead of running them directly from the ./dev/pull.py script, grep out the base containers (being careful to leave others that might be matching the base string), and pull only those, i.e. instead of:

    ./dev/pull.py
    

    one can do something like:

    ./dev/pull.py -p | grep -v '/base' | bash
    

    (We're reverse-grepping for slash-base here so that it doesn't match images such as solr-base.)

pypt avatar Mar 05 '21 15:03 pypt