From a83eb631d638c94206f1060b3fcf81daf0efb0a9 Mon Sep 17 00:00:00 2001 From: Brent Schroeter Date: Fri, 8 May 2026 09:49:32 -0700 Subject: [PATCH] always pull latest package versions in build --- Containerfile | 13 ++++++++++--- build-image.fish | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Containerfile b/Containerfile index cb192e0..db7c2b6 100644 --- a/Containerfile +++ b/Containerfile @@ -9,13 +9,13 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y unminimize RUN yes | unminimize # Install frequently used software dependencies and basics like Git and Fish. -RUN apt-get install -y gpg sudo wget curl build-essential software-properties-common libssl-dev pkg-config libglew-dev git fish +RUN apt-get update && apt-get install -y gpg sudo wget curl build-essential software-properties-common libssl-dev pkg-config libglew-dev git fish # Install handy developer tools. -RUN apt-get install -y iputils-ping postgresql-client git-delta jq sqlite3 vim pipx ripgrep openssh-server +RUN apt-get update && apt-get install -y iputils-ping postgresql-client git-delta jq sqlite3 vim pipx ripgrep openssh-server # Install and configure Podman. -RUN apt-get install -y iptables podman +RUN apt-get update && apt-get install -y iptables podman # Podman doesn't use IPv6, so we only need to update the path for the IPv4 executable. RUN update-alternatives --set iptables /usr/sbin/iptables-legacy COPY --chown=root ./assets/podman/containers.conf /etc/containers/containers.conf @@ -82,5 +82,12 @@ ENV DELTA_FEATURES='side-by-side navigate' ENV COLORTERM=truecolor ENV SHELL=fish +# Always keep packages upgraded to latest versions. +ARG CACHEBUST=1 +USER root +RUN echo "$CACHEBUST" > /dev/null && apt-get update && apt-get upgrade +USER $USERNAME +RUN mise upgrade + # Pop the user into the Fish shell by default. CMD /usr/bin/fish diff --git a/build-image.fish b/build-image.fish index 7480a28..999ee23 100644 --- a/build-image.fish +++ b/build-image.fish @@ -38,6 +38,7 @@ if set -ql _flag_no_cache --build-arg "USERNAME=$_flag_username" \ --build-arg "VCS_EMAIL=$_flag_email" \ --build-arg "VCS_NAME=$_flag_full_name" \ + --build-arg "CACHEBUST=$(date +%s)" \ . else container build -t "$_flag_tag" \ @@ -45,5 +46,6 @@ else --build-arg "USERNAME=$_flag_username" \ --build-arg "VCS_EMAIL=$_flag_email" \ --build-arg "VCS_NAME=$_flag_full_name" \ + --build-arg "CACHEBUST=$(date +%s)" \ . end