-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-layer2.sh
More file actions
executable file
·54 lines (45 loc) · 1.39 KB
/
build-layer2.sh
File metadata and controls
executable file
·54 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Build script for Layer 2: Frappe Bench Image
# Creates: frappe-bench:latest
set -e
echo "=========================================="
echo "Building Layer 2: Frappe Bench"
echo "=========================================="
echo ""
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
source "$REPO_DIR/scripts/lib/image-names.sh"
cd "$SCRIPT_DIR"
# Parse arguments
USERNAME=${1:-$(whoami)}
if [ "$USERNAME" = "--user" ]; then
USERNAME="${2:-$(whoami)}"
fi
BASE_IMAGE="$(resolve_family_base_image dev "$USERNAME" || true)"
echo "Configuration:"
echo " Tag: frappe-bench:latest (user-agnostic)"
echo " Base image: ${BASE_IMAGE:-$(family_base_image dev)}"
echo ""
# Check if Layer 1 exists
if [ -z "$BASE_IMAGE" ]; then
echo "❌ Error: Layer 1 ($(family_base_image dev)) not found!"
echo ""
echo "Please build Layer 1 first:"
echo " cd ../base-image"
echo " ./build.sh --user $USERNAME"
exit 1
fi
# Build the image
echo "Building frappe-bench:latest..."
docker build \
--build-arg BASE_IMAGE="$BASE_IMAGE" \
--build-arg USERNAME="$USERNAME" \
-f Dockerfile.layer2 \
-t "frappe-bench:latest" \
.
echo ""
echo "✓ Layer 2 (Frappe) built successfully!"
echo " Image: frappe-bench:latest"
echo ""
echo "Layer 3 (user personalization) is handled by"
echo "build-layer.sh or scripts/ensure-layer3.sh."