16 lines
629 B
Bash
16 lines
629 B
Bash
#!/bin/bash
|
|
set -Eeuo pipefail
|
|
project_dir=$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
|
version=${1:-}
|
|
if [[ -z $version ]]; then
|
|
version=$(npm view @deepseek-ai/dsh@latest version --registry=https://registry.npmjs.org)
|
|
fi
|
|
if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then
|
|
echo 'Expected an exact DSH version, not a dist-tag or arbitrary build argument.' >&2
|
|
exit 2
|
|
fi
|
|
tag="dsh-web:${version}-7"
|
|
printf 'Building local image %s (no push)\n' "$tag"
|
|
docker build --build-arg "DSH_VERSION=$version" --tag "$tag" "$project_dir/image"
|
|
docker image inspect --format '{{.Id}}' "$tag"
|