Search code examples
dockergoogle-cloud-datalabgoogle-earth-engine

Re-entering Cloud Datalab from docker?


I am using docker to get on a Cloud Datalab so I can use google earth engine.

I initially set things up by using these directions for windows, https://developers.google.com/earth-engine/python_install-datalab-local. Everything worked fine and I got into datalab. Do I have to re-follow these exact instructions to reconnect every time or is there a faster way to re-establish the connection?

I tried to navigate to the workspace that was set up and ran docker run -it -p "127.0.0.1:8081:8080" -v "%WORKSPACE%:/content" -e "PROJECT_ID=%GCP_PROJECT_ID%" %CONTAINER_IMAGE_NAME%

but that returned: Run a Command in a new container


Solution

  • Try to do this

    docker run --name earthengine -d -p "127.0.0.1:8081:8080" -v "%WORKSPACE%:/content" -e "PROJECT_ID=%GCP_PROJECT_ID%" %CONTAINER_IMAGE_NAME%. 
    

    This will run the container in background. Then whenever you want to get inside it use

    docker exec -it earthengine bash
    

    This may or may not worked depending on the startup commands. Also from the documentation it does look like the profile should be re-usable. Also I assume you re-define the environment variables again before running the command