Skip to content

Commit 67d1dc2

Browse files
Update ARGS to streamline customer delivery
1 parent abbbbe6 commit 67d1dc2

1 file changed

Lines changed: 35 additions & 10 deletions

File tree

Dockerfile

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
# syntax=docker/dockerfile:1.4
22

3-
ARG ORG=ngwpc
3+
############################################################################
4+
# Change/Verify these values when adopting this Dockerfile into another org:
5+
# GH_ORG, GHCR_ORG, IMAGE_NAMESPACE,
6+
# EWTS_ORG, EWTS_REF, MSW_MGR_ORG, MSW_MGR_REF
7+
############################################################################
8+
9+
# Ownership / branding overrides
10+
ARG GH_ORG=NGWPC
11+
ARG GHCR_ORG=ngwpc
12+
ARG IMAGE_NAMESPACE=ngwpc
13+
14+
# External repository sources (org and ref/branch overrides)
15+
ARG EWTS_ORG=${GH_ORG}
16+
ARG EWTS_REF=development
17+
ARG MSW_MGR_ORG=${GH_ORG}
18+
ARG MSW_MGR_REF=development
19+
############################################################################
20+
21+
# Image selection
422
ARG NGEN_IMAGE_TAG=latest
5-
ARG NGEN_IMAGE=ghcr.io/${ORG}/ngen:${NGEN_IMAGE_TAG}
23+
ARG NGEN_IMAGE=ghcr.io/${GHCR_ORG}/ngen:${NGEN_IMAGE_TAG}
624
FROM ${NGEN_IMAGE}
725

8-
# Uncomment when building ngen locally or if ngen-int image is available locally
9-
# modify to use image tag for local ngen image if needed
26+
# Uncomment when building ngen locally
1027
#FROM ngen
1128

29+
# Re-expose args after FROM for the remaining build stage
30+
# Keeps whatever value was already set
31+
ARG GH_ORG
32+
ARG GHCR_ORG
33+
ARG IMAGE_NAMESPACE
34+
ARG EWTS_ORG
35+
ARG EWTS_REF
36+
ARG MSW_MGR_ORG
37+
ARG MSW_MGR_REF
38+
1239
# OCI Metadata Arguments
1340
ARG NGEN_IMAGE
1441
ARG BASE_IMAGE_DIGEST="unknown"
@@ -21,12 +48,12 @@ ARG IMAGE_REVISION="unknown"
2148
# OCI Standard Labels
2249
LABEL org.opencontainers.image.base.name="${NGEN_IMAGE}" \
2350
org.opencontainers.image.base.digest="${BASE_IMAGE_DIGEST}" \
24-
io.ngwpc.image.base.revision="${BASE_IMAGE_REVISION}" \
51+
io.${IMAGE_NAMESPACE}.image.base.revision="${BASE_IMAGE_REVISION}" \
2552
org.opencontainers.image.source="${IMAGE_SOURCE}" \
2653
org.opencontainers.image.vendor="${IMAGE_VENDOR}" \
2754
org.opencontainers.image.version="${IMAGE_VERSION}" \
2855
org.opencontainers.image.revision="${IMAGE_REVISION}" \
29-
org.opencontainers.image.title="NGEN Forecast/Hindcast" \
56+
org.opencontainers.image.title="NGEN Forecast/Hindcast Manager" \
3057
org.opencontainers.image.description="Docker image for the NGEN Forecast/Hindcast application"
3158

3259
# Activate the existing virtual environment
@@ -57,8 +84,7 @@ RUN --mount=type=cache,target=/root/.cache/pip,id=pip-cache \
5784
# Build args – override at build time to pin a branch, tag, or full commit SHA:
5885
# docker build --build-arg EWTS_REF=v1.2.3 ...
5986
# docker build --build-arg EWTS_REF=abc123def456 ...
60-
ARG EWTS_ORG=NGWPC
61-
ARG EWTS_REF=development
87+
6288
ARG EWTS_CACHE_BUST=1
6389

6490
# Clone nwm-ewts, install the Python package, capture git metadata for
@@ -81,12 +107,11 @@ RUN --mount=type=cache,target=/root/.cache/pip,id=pip-cache \
81107
rm -rf "${ewts_dir}"
82108

83109
# Install MSWM package
84-
ARG MSW_MGR_VERSION=development
85110
ARG MSWM_CACHE_BUST=1
86111
RUN --mount=type=cache,target=/root/.cache/pip,id=pip-cache \
87112
set -eux; \
88113
echo "MSWM cache bust: ${MSWM_CACHE_BUST}" && \
89-
pip3 install mswm@git+https://github.com/NGWPC/nwm-msw-mgr.git@${MSW_MGR_VERSION} ; \
114+
pip3 install mswm@git+https://github.com/${MSW_MGR_ORG}/nwm-msw-mgr.git@${MSW_MGR_REF} ; \
90115
pip3 cache purge
91116

92117
# Install into the existing virtual environment without upgrading base packages

0 commit comments

Comments
 (0)