From 75400abe0be825357d562a9b7ea848a1b99b2aba Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 18 Sep 2023 08:32:00 +0200 Subject: [PATCH] Change Dockerfile to upgrade packages when building (#26930) Co-authored-by: Renaud Chaput --- .github/workflows/build-container-image.yml | 7 +++++-- .github/workflows/build-releases.yml | 2 ++ Dockerfile | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-container-image.yml b/.github/workflows/build-container-image.yml index 5998794601..b9aebcc46c 100644 --- a/.github/workflows/build-container-image.yml +++ b/.github/workflows/build-container-image.yml @@ -4,6 +4,9 @@ on: platforms: required: true type: string + cache: + type: boolean + default: true use_native_arm64_builder: type: boolean push_to_images: @@ -85,5 +88,5 @@ jobs: push: ${{ inputs.push_to_images != '' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: ${{ inputs.cache && 'type=gha' || '' }} + cache-to: ${{ inputs.cache && 'type=gha,mode=max' || '' }} diff --git a/.github/workflows/build-releases.yml b/.github/workflows/build-releases.yml index 72a12f4dff..c19766b186 100644 --- a/.github/workflows/build-releases.yml +++ b/.github/workflows/build-releases.yml @@ -17,6 +17,8 @@ jobs: push_to_images: | tootsuite/mastodon ghcr.io/mastodon/mastodon + # Do not use cache when building releases, so apt update is always ran and the release always contain the latest packages + cache: false flavor: | latest=false tags: | diff --git a/Dockerfile b/Dockerfile index 172e1cd2c1..577cd08450 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ RUN ARCH= && \ esac && \ echo "Etc/UTC" > /etc/localtime && \ apt-get update && \ + apt-get -yq dist-upgrade && \ apt-get install -y --no-install-recommends ca-certificates wget python3 apt-utils && \ cd ~ && \ wget -q https://nodejs.org/download/release/v$NODE_VER/node-v$NODE_VER-linux-$ARCH.tar.gz && \