Skip to content

Commit f513868

Browse files
committed
Add build-all-dockerfiles script
1 parent 6a613ad commit f513868

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

build-all-dockerfiles.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash -e
2+
3+
# Parse command line arguments.
4+
prune=false
5+
push=false
6+
for key in "$@"; do
7+
case $key in
8+
--prune)
9+
prune=true
10+
;;
11+
--push)
12+
push=true
13+
;;
14+
esac
15+
done
16+
17+
# Read the project version.
18+
PROJECT_VERSION="$(cat ./tensorflow_cc/PROJECT_VERSION)"
19+
20+
for tag in ubuntu ubuntu-cuda archlinux archlinux-cuda; do
21+
docker build --pull -t floopcz/tensorflow_cc:${tag} -f Dockerfiles/${tag} .
22+
docker tag floopcz/tensorflow_cc:${tag} floopcz/tensorflow_cc:${tag}-"${PROJECT_VERSION}"
23+
if $push; then
24+
docker push floopcz/tensorflow_cc:${tag}
25+
docker push floopcz/tensorflow_cc:${tag}-"${PROJECT_VERSION}"
26+
fi
27+
if $prune; then
28+
docker rmi floopcz/tensorflow_cc:${tag}
29+
docker rmi floopcz/tensorflow_cc:${tag}-"${PROJECT_VERSION}"
30+
docker system prune -af
31+
fi
32+
done

0 commit comments

Comments
 (0)