-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·52 lines (46 loc) · 1.06 KB
/
build.sh
File metadata and controls
executable file
·52 lines (46 loc) · 1.06 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
#! /bin/bash
######################################################################
# build.sh - script to build and push the aws-kubectl image
#
# Usage:
# build.sh -v/--version VERSION [-a/--arch ARCH] [-i/--image IMAGE]
#
# Supported architectures: amd64, arm64
# Default architecture: amd64
# Default image: public.ecr.aws/thecombine/aws-kubectl
######################################################################
# Default arguments
ARCH=amd64
IMAGE="public.ecr.aws/thecombine/aws-kubectl"
VERSION=
# Parse arguments to customize installation
while (( "$#" )) ; do
OPT=$1
case $OPT in
-a|--arch)
ARCH=$2
shift
;;
-i|--image)
IMAGE=$2
shift
;;
-v|--version)
VERSION=$2
shift
;;
*)
warning "Unrecognized option: $OPT"
;;
esac
shift
done
if [ -z "${VERSION}" ]; then
echo "-v/--version required"
exit 1
fi
echo "Image: ${IMAGE}"
echo "Tag: ${VERSION}-${ARCH}"
IMAGE=${IMAGE}:${VERSION}-${ARCH}
echo "Building and pushing"
docker build --platform=linux/${ARCH} --push -t ${IMAGE} .