From daa40033fcb430f9949376794e76754091015824 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 8 May 2025 17:16:57 -0500 Subject: [PATCH 1/2] Reorganize base image build arguments in Dockerfile --- docker/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ab7ea6854..b7c27149f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,3 +1,8 @@ +# Define base image build arguments (must be before any FROM) +ARG REPO_OWNER=dispatcharr +ARG REPO_NAME=dispatcharr +ARG BASE_TAG=base + # --- Build frontend --- FROM node:20 AS frontend-builder WORKDIR /app/frontend @@ -6,11 +11,6 @@ RUN corepack enable && corepack prepare yarn@stable --activate && \ yarn install && yarn build && \ rm -rf node_modules .cache -# --- Define base image build arguments --- -ARG REPO_OWNER=dispatcharr -ARG REPO_NAME=dispatcharr -ARG BASE_TAG=base - # --- Final image based on the dynamic base --- FROM ghcr.io/${REPO_OWNER}/${REPO_NAME}:${BASE_TAG} AS final ENV VIRTUAL_ENV=/dispatcharrpy From 60a8bed65a309af63f0807e07ffa86a9e227d46b Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Fri, 9 May 2025 08:16:43 -0500 Subject: [PATCH 2/2] Properly pass build arguments. --- .github/workflows/ci.yml | 1 + docker/Dockerfile | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee26ac3fb..655dac154 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,6 +102,7 @@ jobs: build-args: | REPO_OWNER=${{ steps.meta.outputs.repo_owner }} REPO_NAME=${{ steps.meta.outputs.repo_name }} + BASE_TAG=base BRANCH=${{ github.ref_name }} REPO_URL=https://github.com/${{ github.repository }} TIMESTAMP=${{ steps.timestamp.outputs.timestamp }} diff --git a/docker/Dockerfile b/docker/Dockerfile index b7c27149f..a6491432c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,3 @@ -# Define base image build arguments (must be before any FROM) -ARG REPO_OWNER=dispatcharr -ARG REPO_NAME=dispatcharr -ARG BASE_TAG=base - # --- Build frontend --- FROM node:20 AS frontend-builder WORKDIR /app/frontend @@ -11,6 +6,11 @@ RUN corepack enable && corepack prepare yarn@stable --activate && \ yarn install && yarn build && \ rm -rf node_modules .cache +# --- Redeclare build arguments for the next stage --- +ARG REPO_OWNER +ARG REPO_NAME +ARG BASE_TAG + # --- Final image based on the dynamic base --- FROM ghcr.io/${REPO_OWNER}/${REPO_NAME}:${BASE_TAG} AS final ENV VIRTUAL_ENV=/dispatcharrpy