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.
This commit is contained in:
parent
788004cb97
commit
81f13f789b
1 changed files with 33 additions and 14 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue