Repository navigation
Expand file tree
/
Copy pathdocker-build.sh
More file actions
executable file
·70 lines (65 loc) · 1.79 KB
/
Copy pathdocker-build.sh
File metadata and controls
executable file
·70 lines (65 loc) · 1.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
set -e
# Default values
VERSION="0.4.19.0"
VENDOR="Faustvii"
BRANCH="develop"
IMAGE_NAME="readarr"
TAG="latest"
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--version)
VERSION="$2"
shift 2
;;
--vendor)
VENDOR="$2"
shift 2
;;
--branch)
BRANCH="$2"
shift 2
;;
--image-name)
IMAGE_NAME="$2"
shift 2
;;
--tag)
TAG="$2"
shift 2
;;
--help)
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " --version VERSION Set the version (default: 0.4.19.0)"
echo " --vendor VENDOR Set the vendor (default: Readarr)"
echo " --branch BRANCH Set the branch (default: develop)"
echo " --image-name NAME Set the image name (default: readarr)"
echo " --tag TAG Set the tag (default: latest)"
echo " --help Show this help message"
exit 0
;;
*)
echo "Unknown option: $1"
echo "Use --help for usage information"
exit 1
;;
esac
done
echo "Building Readarr Docker image..."
echo "Version: $VERSION"
echo "Vendor: $VENDOR"
echo "Branch: $BRANCH"
echo "Image: $IMAGE_NAME:$TAG"
# Build the Docker image
docker build \
--build-arg VERSION="$VERSION" \
--build-arg VENDOR="$VENDOR" \
--build-arg BRANCH="$BRANCH" \
--tag "$IMAGE_NAME:$TAG" \
--tag "$IMAGE_NAME:$VERSION" \
.
echo "Build completed successfully!"
echo "You can run the container with:"
echo "docker run -d --name readarr -p 8787:8787 -v /path/to/config:/config $IMAGE_NAME:$TAG"