chore: use blaxsoftware/laravel as default image name, make REGISTRY optional, drop npm@latest install
This commit is contained in:
parent
99eec4efbb
commit
6e1f43fcbc
|
|
@ -113,7 +113,6 @@ RUN mkdir -p /etc/apt/keyrings && \
|
||||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" \
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" \
|
||||||
> /etc/apt/sources.list.d/nodesource.list && \
|
> /etc/apt/sources.list.d/nodesource.list && \
|
||||||
apt-get update && apt-get install -y --no-install-recommends nodejs && \
|
apt-get update && apt-get install -y --no-install-recommends nodejs && \
|
||||||
npm install -g npm@latest && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
IMAGE_NAME="${IMAGE_NAME:-docker-laravel}"
|
IMAGE_NAME="${IMAGE_NAME:-blaxsoftware/laravel}"
|
||||||
NODE_MAJOR="${NODE_MAJOR:-22}"
|
NODE_MAJOR="${NODE_MAJOR:-22}"
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -3,31 +3,28 @@
|
||||||
# publish.sh — Push all built images to a container registry
|
# publish.sh — Push all built images to a container registry
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# REGISTRY=ghcr.io/myorg ./publish.sh # push all versions
|
# ./publish.sh # push all (IMAGE_NAME must include namespace)
|
||||||
# REGISTRY=ghcr.io/myorg ./publish.sh 8.4 # push only PHP 8.4 tags
|
# ./publish.sh 8.4 # push only PHP 8.4 tags
|
||||||
# REGISTRY=ghcr.io/myorg ./publish.sh 8.3 8.4 # push PHP 8.3 + 8.4
|
# REGISTRY=ghcr.io/myorg ./publish.sh # re-tag to different registry and push
|
||||||
#
|
#
|
||||||
# Environment:
|
# Environment:
|
||||||
# REGISTRY — registry prefix (REQUIRED, e.g. ghcr.io/myorg)
|
# IMAGE_NAME — image name (default: blaxsoftware/laravel)
|
||||||
# IMAGE_NAME — image name (default: docker-laravel)
|
# REGISTRY — optional registry (if set, images are re-tagged from IMAGE_NAME to REGISTRY/IMAGE_NAME)
|
||||||
# DRY_RUN — set to 1 to print commands without executing
|
# DRY_RUN — set to 1 to print commands without executing
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [ -z "${REGISTRY:-}" ]; then
|
IMAGE_NAME="${IMAGE_NAME:-blaxsoftware/laravel}"
|
||||||
echo "ERROR: REGISTRY is required."
|
|
||||||
echo ""
|
|
||||||
echo "Usage: REGISTRY=ghcr.io/myorg ./publish.sh [php_versions...]"
|
|
||||||
echo ""
|
|
||||||
echo "Examples:"
|
|
||||||
echo " REGISTRY=ghcr.io/myorg ./publish.sh"
|
|
||||||
echo " REGISTRY=docker.io/myuser ./publish.sh 8.4"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
IMAGE_NAME="${IMAGE_NAME:-docker-laravel}"
|
# If REGISTRY is set, push to REGISTRY/<basename of IMAGE_NAME>; otherwise push IMAGE_NAME directly
|
||||||
LOCAL="${IMAGE_NAME}"
|
if [ -n "${REGISTRY:-}" ]; then
|
||||||
REMOTE="${REGISTRY}/${IMAGE_NAME}"
|
BASE_NAME="$(basename "$IMAGE_NAME")"
|
||||||
|
LOCAL="${IMAGE_NAME}"
|
||||||
|
REMOTE="${REGISTRY}/${BASE_NAME}"
|
||||||
|
else
|
||||||
|
LOCAL="${IMAGE_NAME}"
|
||||||
|
REMOTE="${IMAGE_NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# PHP → Laravel version mapping (must match build.sh)
|
# PHP → Laravel version mapping (must match build.sh)
|
||||||
|
|
@ -130,4 +127,4 @@ echo ""
|
||||||
echo "==========================================="
|
echo "==========================================="
|
||||||
echo " Publish complete"
|
echo " Publish complete"
|
||||||
echo "==========================================="
|
echo "==========================================="
|
||||||
echo "Pushed ${PUSHED} tags to ${REGISTRY}/${IMAGE_NAME}"
|
echo "Pushed ${PUSHED} tags to ${REMOTE}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue