-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-build.sh
37 lines (30 loc) · 1.03 KB
/
docker-build.sh
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
#!/bin/sh
# =======================================================================================
# Build Docker image
#
# This scripts builds the Docker image for ARMv7 processors
# =======================================================================================
# ------------------------------------------------------
# Common parameters
export IMAGE_NAME=arm-subzero
if [[ "$1" = "h" ]] || [[ "$1" = "help" ]] || [[ "$1" = "-h" ]] || [[ "$1" = "-help" ]] || [[ "$1" = "--h" ]] || [[ "$1" = "--help" ]]; then
echo 'Build a Docker image.'
echo ''
echo 'Usage:'
echo ' docker-build.sh [IMAGE_NAME]'
echo ' docker-build.sh h | help | -h | -help | --h | --help'
echo ''
echo 'Options:'
echo " IMAGE_NAME Name of the image [default: ${IMAGE_NAME}]"
echo ''
exit 1
fi
if [[ $1 ]]; then
IMAGE_NAME=$1
else
echo "Using default image name: ${IMAGE_NAME}"
fi
# ------------------------------------------------------
# Commands
echo "Build image: ${IMAGE_NAME}"
docker build -t ${IMAGE_NAME} .