gcloud:如何通过 cli 下载应用程序 [英] gcloud: how to download the app via cli

查看:23
本文介绍了gcloud:如何通过 cli 下载应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 gcloud preview app deploy 解压了一个应用.

I depolyed an app with gcloud preview app deploy.

有没有办法把它下载到其他本地机器上?我怎样才能得到这些文件?我通过 ssh 尝试过但没有成功(无法访问 docker 目录)

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 success (can't access the docker dir)

更新:我发现了这个:

gcloud preview app modules download default --version 1 --output-dir=my_dir

但它没有加载文件

日志

Downloading module [default] to [my_dir/default]
Fetching file list from server...
|- Downloading [0] files...                                 -|

推荐答案

目前,最好的方法是从 Docker 中提取文件.

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

将实例置于自我管理模式,以便您可以通过 ssh 进入:

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

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

查找实例名称:

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

将其从Docker容器中复制出来,更改权限,然后将其复制回您的本地机器:

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
[...]

这篇关于gcloud:如何通过 cli 下载应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆