Home > Mobile >  Dockerized R package don't find "hiden" Google Cloud SDK installation
Dockerized R package don't find "hiden" Google Cloud SDK installation

Time:03-04

I don't find Google Cloud SDK installed inside a dockerized R package (localhost

My outputs is always:

Searching for a valid Google Cloud SDK installation...
Error: 
Google Cloud SDK was not found; press install it following the instructions at
https://cloud.google.com/sdk/docs/install or set an existing installation using function check_gcloud()
(eventually specifying the argument 'gsutil_dir' if the automatic check would fail).
In addition: Warning message:
In normalizePath(path, ...) : path[1]="": No such file or directory

Please, any help with it?

CodePudding user response:

You have two problems - first, you don't have the gcloud command line tool installed inside the container. Second, the ~/.config/gcloud directory is not showing up inside the container.

You can install the gcloud tool by writing a Dockerfile like this:

FROM ranghetti/sen2r:latest
RUN apt-get update \
 && apt-get install -y --no-install-recommends \
        apt-transport-https ca-certificates gnupg \
 && apt-get clean autoclean
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list \
 && curl -fSs https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \
 && apt-get update \
 && apt-get install google-cloud-sdk

This is all pretty much copied from the Google SDK documentation on how to install gcloud on Debian. (The image you're using is based on Debian.)

Once you have that Dockerfile, you can build it using this command:

docker build . -t sen2r-plus-gcloud

Once it's built, you can substitute the new image name, sen2r-plus-gcloud where you used ranghetti/sen2r before.

As for the second problem, with the config directory not showing up, I don't know what's causing the second problem.

  • Related