forked from TechXueXi/TechXueXi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-build-dev.sh
More file actions
33 lines (31 loc) · 796 Bytes
/
docker-build-dev.sh
File metadata and controls
33 lines (31 loc) · 796 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
#!/bin/bash
# eg ./docker-build-dev.sh https://github.com/TechXueXi/TechXueXi.git developing localhost:5000 arm64v8 Dockerfile_arm64v8.dev
USESOURCE='https://github.com/TechXueXi/TechXueXi.git'
USEBRANCHE='developing'
IMAGE_TAG="techxuexi/techxuexi-amd64:${USEBRANCHE}"
PUSH_REGISTRY_URL='docker.io'
DOCKER_FILE='Dockerfile.dev'
if [[ $1 ]]; then
USESOURCE=$1
fi
if [[ $2 ]]; then
USEBRANCHE=$2
fi
if [[ $3 ]]; then
PUSH_REGISTRY_URL=$3
IMAGE_TAG=${PUSH_REGISTRY_URL}/${IMAGE_TAG}
fi
if [[ $4 ]]; then
IMAGE_TAG="techxuexi/techxuexi-$4:${USEBRANCHE}"
fi
if [[ $5 ]]; then
DOCKER_FILE=$5
fi
set -x
docker build \
-f ${DOCKER_FILE} \
--build-arg "usesource=${USESOURCE}" \
--build-arg "usebranche=${USEBRANCHE}" \
--tag "${IMAGE_TAG}" \
.
docker push