FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docker-python/tpu/build at main · Kaggle/docker-python · GitHub
Kaggle
/
docker-python
Public
Notifications
You must be signed in to change notification settings
Fork
1k
Star
2.7k
Code
Issues
25
Pull requests
8
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
docker-python
/
tpu
/
build
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
57 lines (47 loc) · 1.12 KB
Breadcrumbs
docker-python
/
tpu
/
build
Copy path
File metadata and controls
executable file
·
57 lines (47 loc) · 1.12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
51
52
53
54
55
56
57
#!
/bin/bash
set
-e
usage
() {
cat
<<
EOF
Usage:
$0
[OPTIONS]
Build a new Python TPU 1VM Docker image.
Options:
-c, --use-cache Use layer cache when building a new image.
EOF
}
CACHE_FLAG=
'
--no-cache
'
DOCKERFILE=
'
Dockerfile
'
IMAGE_TAG=
'
kaggle/python-tpuvm-build
'
BUILD_ARGS=
'
'
while
:
;
do
case
"
$1
"
in
-h|--help)
usage
exit
;;
-c|--use-cache)
CACHE_FLAG=
'
'
;;
-
?*
)
usage
printf
'
ERROR: Unknown option: %s\n
'
"
$1
"
>&2
exit
;;
*
)
break
esac
shift
done
BUILD_ARGS+=
"
--build-arg GIT_COMMIT=
$(
git rev-parse HEAD
)
"
BUILD_ARGS+=
"
--build-arg BUILD_DATE=
$(
date
'
+%Y%m%d-%H%M%S
'
)
"
#
Read build args from config.txt file.
SRCDIR=
$(
dirname
"
${BASH_SOURCE[0]}
"
)
for
l
in
`
cat
${SRCDIR}
/config.txt
`
;
do
BUILD_ARGS+=
"
--build-arg
$l
"
done
readonly
CACHE_FLAG
readonly
DOCKERFILE
readonly
IMAGE_TAG
readonly
BUILD_ARGS
DOCKERFILE_PATH=
"
$SRCDIR
/
$DOCKERFILE
"
set
-x
docker build --rm --pull
$CACHE_FLAG
-t
"
$IMAGE_TAG
"
-f
"
$DOCKERFILE_PATH
"
$BUILD_ARGS
.
Back
|
FazBrowse Home
|
New Git URL