-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-docker.sh
More file actions
executable file
·30 lines (21 loc) · 937 Bytes
/
Copy pathbuild-docker.sh
File metadata and controls
executable file
·30 lines (21 loc) · 937 Bytes
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
#!/bin/bash
set -e
# Build Docker image with doltswarm included
# This script creates a temporary build context that includes both doltswarmdemo and doltswarm
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR=$(mktemp -d)
echo "Creating build context in $BUILD_DIR"
# Copy doltswarm
cp -r "$SCRIPT_DIR/../code/doltswarm" "$BUILD_DIR/doltswarm"
# Copy doltswarmdemo
cp -r "$SCRIPT_DIR" "$BUILD_DIR/doltswarmdemo"
# Update go.mod to use the local doltswarm path
sed -i.bak 's|github.com/nustiueudinastea/doltswarm => ../code/doltswarm|github.com/nustiueudinastea/doltswarm => ../doltswarm|' "$BUILD_DIR/doltswarmdemo/go.mod"
rm -f "$BUILD_DIR/doltswarmdemo/go.mod.bak"
# Build Docker image
echo "Building Docker image..."
docker build -t doltswarmdemo -f "$BUILD_DIR/doltswarmdemo/Dockerfile" "$BUILD_DIR"
# Cleanup
echo "Cleaning up build context..."
rm -rf "$BUILD_DIR"
echo "Done! Image built successfully."