@bugcrowd/ecs-service-image-updater

中文文档
0.3.4发布于 2025/11/25MITCommonJS近 30 天下载 2891

用新的 Docker 图像更新 ECS 服务

中文使用文档
文档目录3 节
  1. CLI 使用量
  2. 实例
  3. 模块使用

ECS 服务图像更新器

ECS服务图像更新器协助更新一个ECS服务,以使用一个新的多克图像. 如果您正在更改的只是图像( 如您应用程序的新版本) , 创建一个新的任务定义可能很麻烦 。 它将在该处复制当前运行中的任务定义,更新图像,发布新的任务定义并更新该处,以便使用新的任务定义.

注: 我们把包裹移到我们下面了 bugcrowd 国家预防机制组织 -- -- 这将是目前唯一保持的一揽子地点.

CLI 使用量

Options:
  --help                    Show help                                  [boolean]
  --version                 Show version number                        [boolean]
  --image                   Docker image and tag                      [required]
  --container-name          Container to update in the ECS Task Definition.
                            Conflicts with container-names.
  --container-names         List of containers to update in the ECS Task
                            Definition. Comma separated. Conflicts with
                            container-name.
  --service-name            ECS Service to update
  --task-definition-family  Task Definition Family create the new Task
                            Definition in
  --cluster-arn             Arn of the ECS Cluster for which the Service exists
                            on. Used in conjunction with service-name
  --output-arn-only         Output the new Task Definition Arn only

实例

更新 ECS 服务以使用新图像

$ ecs-service-image-updater --cluster-arn arn:aws:ecs:us-east-1:123456789:cluster/cluster --image image:tag --container-name app --service-name app

在任务定义家族中从最新的任务定义创建新的任务定义

$ ecs-service-image-updater --image image:tag --container-name app --task-definition-family app

模块使用

const updater = require('ecs-service-image-updater');

const options = {
  clusterArn: 'clusterArn',
  serviceName: 'serviceName',
  containerNames: ['containerName'],
  image: 'image:tag'
}

updater(options)
  .then((taskDefinitionArn) => {
    console.log(`Done. New task definition: ${taskDefinitionArn}`);
  })
  .catch((err) => {
    console.log(err);
  });

版本与发布记录

@bugcrowd/ecs-service-image-updater 共发布 17 个版本,首次发布于 2021/08/25;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.3.4latest2025/11/2511 个月前
0.3.32024/11/291.9 年前
0.3.22024/08/122 年前
0.3.12024/07/312 年前
0.3.02023/11/242 年前
0.2.02023/11/232 年前

关于 @bugcrowd/ecs-service-image-updater 的常见问题

@bugcrowd/ecs-service-image-updater 是什么?

用新的 Docker 图像更新 ECS 服务

如何安装 @bugcrowd/ecs-service-image-updater?

在项目目录运行 npm install @bugcrowd/ecs-service-image-updater,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ecs-service-image-updater,可以用 npx ecs-service-image-updater 直接运行。

@bugcrowd/ecs-service-image-updater 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bugcrowd__ecs-service-image-updater 是否存在。

@bugcrowd/ecs-service-image-updater 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bugcrowd/ecs-service-image-updater 可以商用吗?

@bugcrowd/ecs-service-image-updater 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bugcrowd/ecs-service-image-updater 的下载量有多少?

根据 npm 官方下载统计,@bugcrowd/ecs-service-image-updater 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,891 次,日均约 96 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bugcrowd/ecs-service-image-updater 还在维护吗?

最新版本 0.3.4 发布于 2025/11/25(11 个月前);至今共发布 17 个版本,其中过去 12 个月发布了 1 个;首次发布于 2021/08/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。