-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·35 lines (27 loc) · 996 Bytes
/
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
#!/bin/bash
# Custom builder script for Skaffold
# https://skaffold.dev/docs/pipeline-stages/builders/custom/
#
DOCKER_STACK_COMMIT=1a66dd36ff821bcef814afe86dbc3dba8cd2198d
GPU_JUPYTER_COMMIT=3c350f0c933156edb49ebccb23142b890c232df6
# Generate jupyter docker image using nvidia docker for gpu support.
# Otherwise, Dockerfile_staroid would be enough.
git clone https://github.com/iot-salzburg/gpu-jupyter.git
cd gpu-jupyter
git checkout $GPU_JUPYTER_COMMIT
# generate Dockerfile
./generate-Dockerfile.sh -c ${DOCKER_STACK_COMMIT} -s --no-datascience-notebook --no-useful-packages
cd .build
# patch Dockerfile.
cat Dockerfile | awk '!p;/# Copy the demo notebooks/{p=1}' > Dockerfile_minimal
# append staroid Dockerfile
cat ../../Dockerfile_staroid | grep -v ^FROM >> Dockerfile_minimal
cp ../../requirements.txt ./
cp -r ../../notebook ./notebook
# print Dockerfile
cat Dockerfile_minimal
# build
docker build -f Dockerfile_minimal -t $IMAGE .
if $PUSH_IMAGE; then
docker push $IMAGE
fi