我正在构建一个使用框架Angular 9编写的网站,为了部署该网站,它需要使用Bitbucket Pipeline进行CI/CD。目前,我正在制作dist文件夹,然后将此文件夹上传到亚马逊网络服务的S3存储桶中,并将其发布为网站。每次我对任何文件进行微小的更改时,我都会从存储桶中删除dist文件夹,并上传新的文件夹。所有这些都应该在Bitbucket Pipelines文件中工作。这是我的bitbucket-pipelines文件。
image: cgswong/aws:aws
pipelines:
branches:
master:
- step:
script:
- aws s3 --region "ap-southeast-1" sync --delete dist/xyz s3://xyz.abc.com
staging:
- step:
script:
- aws s3 --region "ap-southeast-1" sync --delete dist/xyz s3://stage.xyz.abc.com每次,当我尝试部署站点时,都会出现以下错误
failed to create containerd task: failed to create shim: OCI runtime create failed: invalid mount {Destination:~/.aws Type:bind Source:/var/lib/containerd/io.containerd.grpc.v1.cri/containers/4161c400375792a5ad88ec1cf1a89da50ae93ad532e4e490fe94d6c978f2de0f/volumes/0608fb757b1b423a3d52e795531d103a5d8ca6ebcd74c35158f6cbb29890571a Options:[rbind rprivate rw]}: mount destination ~/.aws not absolute: unknown我是CI/CD的新手。可以采取什么措施来解决此问题?
发布于 2021-09-28 14:34:46
看起来你的基础镜像有一些问题。它可能在~/.aws位置不包含您的AWS证书。您能否验证此镜像是否包含您的凭据?
在图片的dockerhub READme中,据说有三种方法可以将证书附加到图片上,如果你所有的工作都写在这里,我看不到任何一种。
发布于 2021-10-25 20:17:05
我已经找到解决方案了。我将docker镜像从' image : cgswong/aws‘编辑为官方镜像'image: amazon/aws-cli:2.0.6’,它开始工作了。
https://stackoverflow.com/questions/69299826
复制相似问题