Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added configure and other mounts #186

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inst/cloudconfig/rstudio-noauth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ write_files:
[Service]
Restart=always
Environment="HOME=/home/gcer"
ExecStartPre=/usr/bin/docker-credential-gcr configure-docker
ExecStartPre=/usr/bin/docker-credential-gcr configure-docker --registries=asia.gcr.io,eu.gcr.io,gcr.io,marketplace.gcr.io,us.gcr.io,docker.pkg.dev,us-docker.pkg.dev,eu-docker.pkg.dev,asia-docker.pkg.dev
ExecStart=/etc/gcer/startup.sh
ExecStop=/usr/bin/docker stop rstudio
ExecStopPost=/usr/bin/docker rm rstudio
Expand Down
2 changes: 1 addition & 1 deletion inst/cloudconfig/rstudio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ write_files:
[Service]
Restart=always
Environment="HOME=/home/gcer"
ExecStartPre=/usr/bin/docker-credential-gcr configure-docker
ExecStartPre=/usr/bin/docker-credential-gcr configure-docker --registries=asia.gcr.io,eu.gcr.io,gcr.io,marketplace.gcr.io,us.gcr.io,docker.pkg.dev,us-docker.pkg.dev,eu-docker.pkg.dev,asia-docker.pkg.dev
ExecStart=/etc/gcer/startup.sh
ExecStop=/usr/bin/docker stop rstudio
ExecStopPost=/usr/bin/docker rm rstudio
Expand Down
15 changes: 14 additions & 1 deletion inst/startupscripts/rstudio-noauth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,23 @@ GCER_DOCKER_IMAGE=$(curl http://metadata.google.internal/computeMetadata/v1/inst

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=rstudio -e DISABLE_AUTH=true \
-e USER=gcer \
${vol_code} \
-e DISABLE_AUTH=true \
--name=rstudio \
--privileged=true \
$GCER_DOCKER_IMAGE