gcloud: how to download the app via cli

前端 未结 3 732
情话喂你
情话喂你 2020-12-07 02:12

I depolyed an app with gcloud preview app deploy.

Is there a way to download it to an other local machine? How can I get the files? I tried it via ssh with no succes

3条回答
  •  感动是毒
    2020-12-07 02:36

    Currently, the best way to do this is to pull the files out of Docker.

    Put instance into self-managed mode, so that you can ssh into it:

    $ gcloud preview app modules set-managed-by default --version 1 --self
    

    Find the name of the instance:

    $ gcloud compute instances list | grep gae-default-1
    

    Copy it out of the Docker container, change the permissions, and copy it back to your local machine:

    $ gcloud compute ssh --zone=us-central1-f gae-default-1-1234 'sudo docker cp gaeapp:/app /tmp'
    $ gcloud compute ssh --zone=us-central1-f gae-default-1-1234 "chown -R $USER /tmp/app"
    $ gcloud compute copy-files --zone=us-central1-f gae-default-1-1234:/tmp/app /tmp/
    $ ls /tmp/app
    Dockerfile
    [...]
    

提交回复
热议问题