From 81f13f789b93b11a416b819d72e76ede4ca636ea Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 25 Jan 2026 11:12:37 -0600 Subject: [PATCH] revert: remove custom base image dependency from main Dockerfile Reverted k8s/Dockerfile back to using official hexpm/elixir and debian images directly instead of custom gmcintire/towerops-base images. This restores the original Dockerfile behavior where all dependencies are installed during each build. The base image work in k8s/base-image/ remains available but is not used by the main application build. --- k8s/Dockerfile | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/k8s/Dockerfile b/k8s/Dockerfile index 6b062598..57270e3e 100644 --- a/k8s/Dockerfile +++ b/k8s/Dockerfile @@ -17,18 +17,27 @@ ARG ELIXIR_VERSION=1.19.4 ARG OTP_VERSION=28.3 ARG DEBIAN_VERSION=trixie-20251229-slim -# Use custom base images with pre-installed dependencies for faster builds -ARG BUILDER_IMAGE="docker.io/gmcintire/towerops-base:builder" -ARG RUNNER_IMAGE="docker.io/gmcintire/towerops-base:runtime" +ARG BUILDER_IMAGE="docker.io/hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}" +ARG RUNNER_IMAGE="docker.io/debian:${DEBIAN_VERSION}" FROM ${BUILDER_IMAGE} AS builder +ENV MIX_OS_DEPS_COMPILE_PARTITION_COUNT=6 -# Base image already has: -# - build-essential and git installed -# - hex and rebar installed -# - MIX_OS_DEPS_COMPILE_PARTITION_COUNT=6 -# - MIX_ENV="prod" -# - WORKDIR /app +# install build dependencies +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential git \ + && rm -rf /var/lib/apt/lists/* + +# prepare build dir +WORKDIR /app + +# install hex + rebar +RUN mix local.hex --force \ + && mix local.rebar --force + +# set build ENV +ENV MIX_ENV="prod" # install mix dependencies COPY mix.exs mix.lock ./ @@ -71,11 +80,21 @@ RUN mix release # the compiled release and other runtime necessities FROM ${RUNNER_IMAGE} AS final -# Base image already has: -# - All runtime dependencies installed (libstdc++6, openssl, libncurses6, locales, ca-certificates, iputils-ping) -# - Locale configured (en_US.UTF-8) -# - /app directory created and owned by nobody -# - WORKDIR "/app" +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libstdc++6 openssl libncurses6 locales ca-certificates iputils-ping \ + && rm -rf /var/lib/apt/lists/* + +# Set the locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ + && locale-gen + +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +WORKDIR "/app" +RUN chown nobody /app # set runner ENV ENV MIX_ENV="prod"