【问题标题】:How to resolve "failed to create containerd task: failed to create shim: OCI runtime create failed: invalid mount" error?如何解决“创建容器任务失败:创建垫片失败:OCI 运行时创建失败:安装无效”错误?
【发布时间】:2021-11-16 20:12:00
【问题描述】:

我正在构建一个使用框架 Angular 9 编写的网站,并且为了部署该网站,需要使用 Bitbucket Pipelines 进行 CI/CD。目前,我正在制作一个 dist 文件夹,然后将此文件夹上传到 AWS S3 存储桶并将其发布为网站。每次我对任何文件进行微小更改时,我都会从存储桶中删除 dist 文件夹并上传新文件夹。所有这些都应该在 Bitbucket Pipelines yml 文件中工作。 这是我的 bitbucket-pipelines yml 文件。

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 的新手。有什么办法可以解决这个问题?

【问题讨论】:

    标签: amazon-web-services amazon-s3 bitbucket-pipelines


    【解决方案1】:

    您的基本映像似乎存在一些问题。可能它不包含您在 ~/.aws 位置中的 AWS 凭据。你能验证这张图片是否包含你的信任吗?

    在镜像的 dockerhub READme 中,据说有 3 种方法可以将 creds 附加到镜像,如果你所有的工作都写在这里,我看不到任何一个。

    文档:https://hub.docker.com/r/cgswong/aws

    【讨论】:

      【解决方案2】:

      我找到了解决方案。 我将 docker 图像从 'image: cgswong/aws' 编辑为官方的 'image: amazon/aws-cli:2.0.6' 并开始工作。

      【讨论】:

        猜你喜欢
        • 2022-12-03
        • 2023-01-27
        • 1970-01-01
        • 1970-01-01
        • 2020-06-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-07-16
        相关资源
        最近更新 更多