From 2e869f5ec8d764349003cd042e2327d316bc481e Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Tue, 12 Nov 2024 20:22:36 -0700 Subject: [PATCH] feature (#752): build args GIT_REPO GIT_REF --- docker/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 4e8f30b7..cab811c1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,13 @@ # STEP1: CLONE THE CODE FROM alpine:latest as builder_prepare WORKDIR /home/ -RUN apk add git && \ - git clone --depth 1 https://github.com/mickael-kerjean/filestash +ARG GIT_REPO=https://github.com/mickael-kerjean/filestash +ARG GIT_REF=master +RUN apk add --no-cache git && \ + git init filestash && \ + git -C filestash remote add origin ${GIT_REPO} && \ + git -C filestash fetch --depth 1 origin ${GIT_REF} && \ + git -C filestash checkout FETCH_HEAD # STEP2: BUILD THE FRONTEND FROM node:18-alpine AS builder_frontend