-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild_docker_image.sh
More file actions
executable file
·49 lines (41 loc) · 1.47 KB
/
build_docker_image.sh
File metadata and controls
executable file
·49 lines (41 loc) · 1.47 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
#!/bin/bash
# Script to build the lean-docker-mcp Docker image
set -e # Exit on error
# Default values
DEFAULT_TAG="latest"
DEFAULT_IMAGE_NAME="lean-docker-mcp"
# Parse command-line arguments
image_name=$DEFAULT_IMAGE_NAME
tag=$DEFAULT_TAG
while [[ "$#" -gt 0 ]]; do
case $1 in
-t|--tag) tag="$2"; shift ;;
-n|--name) image_name="$2"; shift ;;
-h|--help)
echo "Usage: $0 [options]"
echo "Options:"
echo " -t, --tag TAG Specify the Docker image tag (default: $DEFAULT_TAG)"
echo " -n, --name NAME Specify the Docker image name (default: $DEFAULT_IMAGE_NAME)"
echo " -h, --help Display this help message"
exit 0
;;
*) echo "Unknown parameter: $1"; exit 1 ;;
esac
shift
done
echo "Building Docker image: $image_name:$tag"
# Check if Dockerfile exists
dockerfile_path="src/lean_docker_mcp/Dockerfile"
if [ ! -f "$dockerfile_path" ]; then
echo "Error: Dockerfile not found at $dockerfile_path"
exit 1
fi
# Build the Docker image - context should be at the directory level of the Dockerfile
docker build -t "$image_name:$tag" -f "$dockerfile_path" src/lean_docker_mcp
echo "Image $image_name:$tag built successfully!"
echo
echo "You can run a test container with:"
echo "docker run --rm -it $image_name:$tag"
echo
echo "To change the default configuration, update src/lean_docker_mcp/default_config.yaml"
echo "and set docker.image to $image_name:$tag"