我是谷歌云服务的新手,我正在尝试设置我的产品的自动构建,需要下载大量文件。
我想从 Docker 构建过程中的专用 Google Storage 存储桶下载文件。为此,我已将以下行添加到我的Dockerfile:
RUN curl https://storage.cloud.google.com/[bucketname]/[filename] -o [filename]
Run Code Online (Sandbox Code Playgroud)
由于此存储桶中的文件不应公开访问,因此我禁用了对象级别权限并将权限添加到成员[ProjectID]@cloudbuild.gserviceaccount.com中Storage Object Viewer。
但是当docker文件脚本运行时,下载的文件是空的
Step 7/9 : RUN curl https://storage.cloud.google.com/[bucketname]/[filename] -o [filename]
---> Running in 5d1a5a1bbe87
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Removing intermediate container 5d1a5a1bbe87 …Run Code Online (Sandbox Code Playgroud) google-cloud-storage google-cloud-platform google-cloud-build