-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathrstudio-noauth.sh
More file actions
33 lines (28 loc) · 978 Bytes
/
rstudio-noauth.sh
File metadata and controls
33 lines (28 loc) · 978 Bytes
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
#!/bin/bash
echo "Docker RStudio launch script"
GCER_DOCKER_IMAGE=$(curl http://metadata.google.internal/computeMetadata/v1/instance/attributes/gcer_docker_image -H "Metadata-Flavor: Google")
# PORT=$(curl http://metadata.google.internal/computeMetadata/v1/instance/attributes/gcer_port -H "Metadata-Flavor: Google")
# if [ -z "$PORT" ];
# then
# PORT=80
# fi
echo "Docker image: $GCER_DOCKER_IMAGE"
if [ -d /home/gcer ];
then
chmod 775 /home/gcer
vol_code="-v /home/gcer:/home/gcer"
fi
# Need to mount in / because of filesystem noexec
# https://cloud.google.com/container-optimized-os/docs/concepts/security
mkdir -p /R/library
chown gcer:gcer -R /R
vol_code="${vol_code} -v /R:/R"
# as per https://www.rocker-project.org/use/managing_users/
docker run -p 8787:8787 \
-e ROOT=TRUE \
-e USER=gcer \
${vol_code} \
-e DISABLE_AUTH=true \
--name=rstudio \
--privileged=true \
$GCER_DOCKER_IMAGE