-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_docker
More file actions
executable file
·35 lines (32 loc) · 837 Bytes
/
build_docker
File metadata and controls
executable file
·35 lines (32 loc) · 837 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
31
32
33
34
35
#!/usr/bin/env bash
DOCKER_cmd=`which docker`
DOCKER_IMAGE_NAME="iac-tools"
DOCKER_IMAGE_TAG="latest"
while getopts ":t:n:h" opt; do
case ${opt} in
h )
echo "Usage: $0 [-h|-t|-n]"
echo " -h Display help message"
echo " -n Docker image name"
echo " -t Docker image tag"
exit 0
;;
n )
DOCKER_IMAGE_NAME=$OPTARG
;;
t )
DOCKER_IMAGE_TAG=$OPTARG
;;
\? )
echo "Invalid option: $OPTARG" 1>&2
exit 1
;;
: )
echo "Invalid option: $OPTARG requires an argument" 1>&2
exit -1
;;
esac
done
shift $((OPTIND -1))
${DOCKER_cmd} build . -t ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}
# vim: filetype=bash