-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_images.sh
executable file
·50 lines (40 loc) · 1 KB
/
build_images.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
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# https://docs.docker.com/engine/reference/commandline/build/#squash-an-images-layers-squash-experimental-only
#docker image prune -a
version=$(date +"%d%m%Y")
#export DOCKER_ID_USER=$(whoami)
#docker login
#for folder in $(ls -d */)
for folder in \
spark-hadoop-base \
hadoop \
spark-master \
spark-worker \
spark-master-dirac \
spark-worker-dirac
do
name=${folder%%/}
echo
echo "==========================================="
echo "Building: "$name
echo "==========================================="
cmd="docker build -t fdiblen/$name:$version -t fdiblen/$name:latest ./$name"
echo
echo "Running:"
echo $cmd
echo
echo
eval $cmd
if [ $? -eq 0 ]
then
echo
echo "Successfully built the $name image!"
else
echo
echo "Could not built the $name image" >&2
exit $?
fi
### https://docs.docker.com/docker-cloud/builds/push-images/
#docker push fdiblen/$name:$version
#docker push fdiblen/$name:latest
done