gsutil
copy bucket to another bucket
1 | curl -L https://xx/xxx.rar | gsutil cp - gs://your/folder/xx.rar |
update
升级组件
1 | gcloud components update |
Docker
构建运行docker
- Dockerfile
1 | FROM java:openjdk-8-jdk-alpine |
- Depoly
1 | # 默认美国服务器 |
注意PROJECT_ID不是自定义的,而是自动生成的
官方参考文档
Push Docker
- 命令格式:docker tag [IMAGE] [HOSTNAME]/[PROJECT-ID]/[IMAGE]
例如,docker tag quickstart-image gcr.io/my-project/quickstart-image
- 命令格式:gcloud docker – push [HOSTNAME]/[PROJECT-ID]/[IMAGE]
例如,gcloud docker – push gcr.io/my-project/quickstart-image
- 查看Image
https://console.cloud.google.com/gcr
Pull Docker
- 命令格式:gcloud docker – pull [HOSTNAME]/[PROJECT-ID]/[IMAGE]
View Docker
- 命令格式:gcloud container images list [HOSTNAME]/[PROJECT-ID]/[IMAGE]
Delete Docker
- 命令格式:gcloud container images delete [HOSTNAME]/[PROJECT-ID]/[IMAGE]
转换成Google构建脚本
1 | steps: |
构建命令
1 | gcloud container builds submit --config cloudbuild.yaml . |
注意:在使用上述命令打包本地文件到GCP时候,会检查本地ignore配置文件,对于忽略的文件及文件夹不会被打包到GCP进行构建