Skip to content

Commit 62fd0ab

Browse files
authored
fix: switch 8.0.1 Dockerfile from archive to git clone (#604)
OpenEMR's .gitattributes now marks tests/, phpunit*.xml, and other dev files as export-ignore (openemr/openemr#11213). GitHub archives respect these rules, so the 8.0.1 image was missing test files needed by the CI test suite. Switch to git clone --depth 1 which ignores export-ignore rules, matching the approach used by the older production Dockerfiles. Fixes #603
1 parent 2371148 commit 62fd0ab

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

docker/openemr/8.0.1/Dockerfile

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,24 +147,18 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin -
147147
# ============================================================================
148148
# MULTI-STAGE BUILD: OpenEMR Source and Dependencies
149149
# ============================================================================
150-
# Stage 1: Fetch OpenEMR source code from GitHub archive
151-
# Using archive instead of git clone eliminates .git directory overhead
152-
# Supports tags, branches, or commits via OPENEMR_VERSION build argument
150+
# Stage 1: Fetch OpenEMR source code via git clone
151+
# Use git clone instead of GitHub archive because OpenEMR's .gitattributes
152+
# marks tests/, phpunit*.xml, and other dev files as export-ignore, which
153+
# excludes them from archives but not from clones.
154+
# Supports branches or tags via OPENEMR_VERSION build argument.
153155
# Examples:
154-
# - Branch: --build-arg OPENEMR_VERSION=refs/heads/master
155-
# - Tag: --build-arg OPENEMR_VERSION=refs/tags/7.0.5
156-
# - Commit: --build-arg OPENEMR_VERSION=abc123def456
157-
# Note: GitHub archives extract to openemr-<ref-name> where ref-name is the
158-
# last component of the path (e.g., "master" from "refs/heads/master")
159-
ARG OPENEMR_VERSION=refs/heads/master
156+
# - Branch: --build-arg OPENEMR_VERSION=master
157+
# - Tag: --build-arg OPENEMR_VERSION=v7.0.5
158+
ARG OPENEMR_VERSION=master
160159
FROM base AS openemr-source
161-
# Extract the last component of the ref path for directory name
162-
# refs/heads/master -> master, refs/tags/7.0.5 -> 7.0.5, abc123 -> abc123
163-
# GitHub archives always extract to openemr-<last-component> directory
164-
RUN apk add --no-cache curl tar \
165-
&& OPENEMR_REF_NAME="${OPENEMR_VERSION##*/}" \
166-
&& curl -L "https://github.com/openemr/openemr/archive/${OPENEMR_VERSION}.tar.gz" | tar -xz \
167-
&& mv "openemr-${OPENEMR_REF_NAME}" openemr
160+
RUN git clone https://github.com/openemr/openemr.git --branch "${OPENEMR_VERSION}" --depth 1 \
161+
&& rm -rf openemr/.git
168162

169163
# Stage 2: Install PHP dependencies (Composer)
170164
# Separate stage allows Docker to cache this layer independently

0 commit comments

Comments
 (0)