🐳 Attempt 3 (fixed): Use --build-arg and ARG for DEPS_HASH
This commit is contained in:
@@ -54,21 +54,22 @@ jobs:
|
||||
source VERSION
|
||||
IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}"
|
||||
|
||||
# Use the calculated dependency hash and export it
|
||||
# Use the calculated dependency hash and set it as environment variable
|
||||
DEPS_HASH="${{ steps.calc_hash.outputs.deps_hash }}"
|
||||
echo "Using dependency hash: $DEPS_HASH"
|
||||
export DEPS_HASH
|
||||
echo "DEPS_HASH=$DEPS_HASH" >> $GITHUB_ENV
|
||||
|
||||
TAGS="$IMAGE_VERSION latest ${{ github.sha }}"
|
||||
echo "Building Docker image with tags: $TAGS"
|
||||
|
||||
# Build the production image using inline version with prebuilt cache image
|
||||
# Fixed: Proper working directory and source code copying
|
||||
docker build -t dance-lessons-coach -f - . <<EOF
|
||||
# Fixed: Use $GITHUB_ENV variable in the inline Dockerfile
|
||||
docker build -t dance-lessons-coach -f - --build-arg DEPS_HASH . <<EOF
|
||||
# dance-lessons-coach Production Docker Image
|
||||
# Inline Dockerfile using prebuilt cache image
|
||||
|
||||
# Use the build cache image as base
|
||||
ARG DEPS_HASH
|
||||
FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${DEPS_HASH} AS builder
|
||||
|
||||
# Copy source code to the correct working directory
|
||||
|
||||
Reference in New Issue
Block a user