This repository was archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.envrc
More file actions
70 lines (56 loc) · 1.24 KB
/
.envrc
File metadata and controls
70 lines (56 loc) · 1.24 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
#set -e
#set -u
#set -x
MINIKUBE_INCLUDED=false
MINIKUBE_VERSION=v1.0.0
# If bin folder does not exist create it
if [ ! -d ${PWD}/bin ]; then
mkdir -p ${PWD}/bin;
fi
# download the latest runsc binaries
function download_runsc {
if [ ! -f ${PWD}/bin/runsc ]
then
curl -sLo ${PWD}/bin/runsc https://storage.googleapis.com/gvisor/releases/nightly/latest/runsc
chmod a+x ${PWD}/bin/runsc
fi
}
function generate_docker_daemon_json {
echo "
*** gVisor Playground
-
Please copy paste the folowing snippet on '/etc/docker/daemon.json' and restart docker using 'sudo systemctl restart docker'.
--- SNIPPET START
{
\"runtimes\": {
\"runsc\": {
\"path\": \"${PWD}/bin/runsc\"
}
}
}
--- SNIPPET END
"
}
# download minikube if does not exist
function download_minikube {
if [ ! -f ${PWD}/bin/minikube ]
then
curl -sLo ${PWD}/bin/minikube https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64
chmod +x ${PWD}/bin/minikube
fi
}
case "$OSTYPE" in
linux*)
download_runsc
if ${MINIKUBE_INCLUDED}
then
download_minikube
fi
generate_docker_daemon_json
;;
*)
echo "unsupported OS : $OSTYPE"
;;
esac
# set env PATH
export PATH="${PATH}:${PWD}/bin"