-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_build.sh
36 lines (34 loc) · 1.03 KB
/
docker_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
#!/bin/bash
# build the image
docker build -t docker-jupyterlab .
# Check the hashed passwaord is set by user in Dockerfile.
while read line
do
if [[ $line == "ARG JUPYTER_PASSWD=''" ]]; then
# Notice user to set jupyter notenook password
echo ""
echo ""
echo "The jupyter notebook password is not set in the Dockerfile. To obtain the hashed password, run the image:"
echo ""
echo " $ docker run --rm -it nvidia_docker_base"
echo ""
echo "Run the following python script and enter your password."
echo ""
echo " $ python3 ~/scripts/pass.py"
echo ""
echo "Then, the script outpus the hashed password, please copy it."
echo ""
echo "Exit from the docker container."
echo " $ exit"
echo ""
echo "Please set JUPYTER_PASSWD variable in the Dockerfile."
echo "ex. ARG JUPYTER_PASSWD='sha1:25e2bc817b10:917f1e38841d80dfa40535f60a88bc83c5228297'"
echo ""
echo "Finally, build the docker image again and run."
echo ""
echo " $ ./docker_build.sh"
echo " $ ./docker_run.sh"
echo ""
exit 1
fi
done < ./Dockerfile