-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·39 lines (35 loc) · 1.38 KB
/
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
38
#!/bin/bash
: ${OCI_REG:="docker.io"}
: ${REPO_NAME:="kniec"}
: ${DD_SOURCE:="zero"}
: ${IMG_TAG_PREFIX:="zero"}
## First iteration
#docker build -t ${OCI_REG}/${REPO_NAME}/plain-size-test:${IMG_TAG_PREFIX}-0 \
# --build-arg=FILENR=0 \
# --build-arg=DD_SOURCE=${DD_SOURCE} \
# --build-arg=FROM_IMG_REPO=library \
# .
#docker push ${OCI_REG}/${REPO_NAME}/plain-size-test:${IMG_TAG_PREFIX}-0
#for x in {1..10};do
for x in ;do
docker build -t ${OCI_REG}/${REPO_NAME}/plain-size-test:${IMG_TAG_PREFIX}-${x} \
--build-arg=FILENR=${x} \
--build-arg=DD_SOURCE=${DD_SOURCE} \
--build-arg=DOCKER_REGISTRY=${OCI_REG} \
--build-arg=FROM_IMG_REPO=${REPO_NAME} \
--build-arg=FROM_IMG_NAME=plain-size-test \
--build-arg=FROM_IMG_TAG=${IMG_TAG_PREFIX}-$((${x}-1)) \
.
docker push ${OCI_REG}/${REPO_NAME}/plain-size-test:${IMG_TAG_PREFIX}-${x}
done
if [[ "X${1}" == "Xsquash" ]];then
docker build -t ${OCI_REG}/${REPO_NAME}/plain-size-test:${IMG_TAG_PREFIX}-squashed \
-f=Dockerfile.squash \
--build-arg=DD_SOURCE=${DD_SOURCE} \
--build-arg=DOCKER_REGISTRY=${OCI_REG} \
--build-arg=FROM_IMG_REPO=${REPO_NAME} \
--build-arg=FROM_IMG_NAME=plain-size-test \
--build-arg=FROM_IMG_TAG=${IMG_TAG_PREFIX}-10 \
.
docker push ${OCI_REG}/${REPO_NAME}/plain-size-test:${IMG_TAG_PREFIX}-squashed
fi