Files
dify/cli/scripts/docker-build-dev.sh
GareArc c2b91d849d ci(cli): replace Makefile with pnpm scripts, add Dockerfile.dev and CI workflows
- Replace Makefile with package.json scripts (ci, clean, docker:build-dev,
  sync-models, version:info); update cli-tests.yml to use pnpm ci
- Add cli/Dockerfile.dev: multi-stage local build from monorepo source,
  proper cache layer order, non-root user, corepack-driven pnpm version
- Add .dockerignore at repo root to exclude node_modules/dist/.git from
  build context
- Add cli-docker-build.yml: PR + merge_group validation of Dockerfile.dev,
  amd64+arm64 via Depot for org; amd64-only for forks
- cli-release.yml: pin action SHAs, depot-ubuntu-24.04 runner, move
  verify-release step before build for fast-fail
- main-ci.yml: add packages/tsconfig/** and cli-docker-build.yml to cli
  path filter
- Drop cli/docs/specs/** and cli/docs/*.md (superseded)
2026-05-14 22:10:42 -07:00

30 lines
800 B
Bash
Executable File

#!/usr/bin/env bash
# Build difyctl image from local source using Dockerfile.dev.
# Context is the repo root so workspace deps (packages/tsconfig) are available.
#
# Usage:
# scripts/docker-build-dev.sh [IMAGE_TAG]
#
# Examples:
# scripts/docker-build-dev.sh # → ghcr.io/langgenius/difyctl:dev
# scripts/docker-build-dev.sh ghcr.io/langgenius/difyctl:pr-123
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLI_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
REPO_ROOT="$(cd "$CLI_DIR/.." && pwd)"
TAG="${1:-ghcr.io/langgenius/difyctl:dev}"
echo "→ Building difyctl from source"
echo " context : $REPO_ROOT"
echo " tag : $TAG"
docker build \
--file "$CLI_DIR/Dockerfile.dev" \
--tag "$TAG" \
"$REPO_ROOT"
echo "✓ Built $TAG"