Update docker tag

This commit is contained in:
2026-10-16 20:12:11 -05:00
parent 5d8549af2e
commit 1c5e045591
2 changed files with 15 additions and 16 deletions

View File

@@ -300,15 +300,18 @@ A few volume types ignore `fsGroup` (`hostPath`, and some NFS and local-path
provisioners). For those, `chown 10001:10001` the backing directory once, or provisioners). For those, `chown 10001:10001` the backing directory once, or
add an init container that does it. add an init container that does it.
To build the image yourself and push it to your own registry: To build the image and push it to Docker Hub
([`glmdev/mtgc`](https://hub.docker.com/r/glmdev/mtgc)):
```bash ```bash
DOCKER_REGISTRY=registry.example.com npm run sync-server:build # → registry.example.com/mtgc/sync-server:latest npm run sync-server:build # → docker.io/glmdev/mtgc:latest
DOCKER_REGISTRY=registry.example.com npm run sync-server:push npm run sync-server:push # after `docker login docker.io`
``` ```
Both call `scripts/sync-server-image.sh`. `IMAGE_TAG` overrides the `latest` Both call `scripts/sync-server-image.sh`. `IMAGE_TAG` overrides the `latest`
tag, and `CONTAINER_ENGINE=podman` picks podman when docker is also installed. tag, `IMAGE_REPO` points it at another repository (e.g.
`IMAGE_REPO=registry.example.com/mtgc`), and `CONTAINER_ENGINE=podman` picks
podman when docker is also installed.
Configuration is all environment variables: Configuration is all environment variables:

View File

@@ -2,26 +2,27 @@
# #
# sync-server-image.sh — build or push the mtgc sync server's container image. # sync-server-image.sh — build or push the mtgc sync server's container image.
# #
# The image is tagged ${DOCKER_REGISTRY}/mtgc/sync-server:${IMAGE_TAG}. # The image is tagged ${IMAGE_REPO}:${IMAGE_TAG}, by default the Docker Hub
# repository docker.io/glmdev/mtgc:latest.
# #
# Usage: # Usage:
# DOCKER_REGISTRY=registry.example.com ./scripts/sync-server-image.sh build # ./scripts/sync-server-image.sh build
# DOCKER_REGISTRY=registry.example.com ./scripts/sync-server-image.sh push # ./scripts/sync-server-image.sh push
# #
# Or through npm: `npm run sync-server:build` / `npm run sync-server:push`. # Or through npm: `npm run sync-server:build` / `npm run sync-server:push`.
# #
# Environment: # Environment:
# DOCKER_REGISTRY (required) registry host, optionally with a namespace path # IMAGE_REPO repository to tag/push (default: docker.io/glmdev/mtgc)
# IMAGE_TAG tag to build/push (default: latest) # IMAGE_TAG tag to build/push (default: latest)
# CONTAINER_ENGINE docker or podman (default: docker if installed, else podman) # CONTAINER_ENGINE docker or podman (default: docker if installed, else podman)
# #
# `push` pushes what `build` produced; it doesn't rebuild. Log in to the # `push` pushes what `build` produced; it doesn't rebuild. Log in to the
# registry first (`docker login "$DOCKER_REGISTRY"`). # registry first (`docker login docker.io`).
# #
set -euo pipefail set -euo pipefail
usage() { usage() {
sed -n '3,20p' "$0" | sed 's/^# \{0,1\}//' sed -n '3,21p' "$0" | sed 's/^# \{0,1\}//'
exit "${1:-0}" exit "${1:-0}"
} }
@@ -32,11 +33,6 @@ case "$1" in
*) usage 1 ;; *) usage 1 ;;
esac esac
if [ -z "${DOCKER_REGISTRY:-}" ]; then
echo "sync-server-image: set DOCKER_REGISTRY (e.g. registry.example.com)" >&2
exit 1
fi
engine="${CONTAINER_ENGINE:-}" engine="${CONTAINER_ENGINE:-}"
if [ -z "$engine" ]; then if [ -z "$engine" ]; then
if command -v docker >/dev/null 2>&1; then if command -v docker >/dev/null 2>&1; then
@@ -49,7 +45,7 @@ if [ -z "$engine" ]; then
fi fi
fi fi
image="${DOCKER_REGISTRY%/}/mtgc/sync-server:${IMAGE_TAG:-latest}" image="${IMAGE_REPO:-docker.io/glmdev/mtgc}:${IMAGE_TAG:-latest}"
# The Dockerfile builds from the workspace root, so run from there whatever # The Dockerfile builds from the workspace root, so run from there whatever
# directory this was invoked in. # directory this was invoked in.