#!/usr/bin/env bash # Daemonless ui/Dockerfile.ui: append the built ui/dist and rendered nginx conf # onto the nginx base. Usage: scripts/ui-image.sh [extra-tag...] set -euo pipefail base_path=${BASE_PATH:-/ui} image=$1 shift root=$(mktemp -d) mkdir -p "$root/usr/share/nginx/html" "$root/etc/nginx/conf.d" cp -r ui/dist/. "$root/usr/share/nginx/html/" sed "s|\${BASE_PATH}|${base_path}|g" ui/nginx.conf >"$root/etc/nginx/conf.d/default.conf" tar -C "$root" --owner=0 --group=0 --numeric-owner -cf "$root.tar" usr etc crane append --platform linux/amd64 -b nginx:alpine -f "$root.tar" -t "$image" for tag in "$@"; do crane tag "$image" "$tag" done