【以下的问题经过翻译处理】 我正在试验 AWS Copilot。我有一个现有的普通 nodejs 项目,它已经用 Docker 容器化了。我正在尝试将它与 AWS Copilot 结合使用,以了解 Copilot。请注意,我在 Macbook Pro M1 上运行它,我想知道这是架构问题还是转移注意力...
copilot init
过程失败(在成功完成很多操作之后):
=> [run 1/1] RUN yarn build 28.2s
=> exporting to image 5.1s
=> => exporting layers 5.1s
=> => writing image sha256:260f1aae6a9d11b023672a1f3753161d1d38afa118c483804f9ef79d0c4e52a1 0.0s
=> => naming to xxx.dkr.ecr.us-east-2.amazonaws.com/em-sandbox/em-nodejs-service-template 0.0s
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Login Succeeded
Using default tag: latest
The push refers to repository [xxx.dkr.ecr.us-east-2.amazonaws.com/em-sandbox/em-nodejs-service-template]
97b95ee3261b: Pushed
59618adc7d11: Pushed
4c3b5d9c5d94: Pushed
1c37a59f80eb: Pushed
099cd5535f68: Pushed
bb2ebe54bcf0: Pushed
cd2258b7ca68: Pushed
fbf63a621b59: Pushed
994393dc58e7: Pushed
latest: digest: sha256:2481df4d9803e63ddde3992a9224cda89e27365d859f627c962692436715e14a size: 2208
✘ upload deploy resources for service em-nodejs-service-template: read custom resources for a "Load Balanced Web Service": read custom resource NLBCertValidatorFunction at path custom-resources/nlb-cert-validator.js: read template custom-resources/nlb-cert-validator.js: open templates/custom-resources/nlb-cert-validator.js: file does not exist
值得一提的是,以下是我如何在copilot init中回答最初的问题。我还要求设置一个测试环境。
Application name: em-sandbox
Workload type: Load Balanced Web Service
Service name: em-nodejs-service-template
Dockerfile: ./Dockerfile
Port: 4000
Ok great, we'll set up a Load Balanced Web Service named em-nodejs-service-template in application em-sandbox listening on port 4000.
✔ Proposing infrastructure changes for stack em-sandbox-infrastructure-roles
- Creating the infrastructure for stack em-sandbox-infrastructure-roles [create complete] [40.8s]
- A StackSet admin role assumed by CloudFormation to manage regional stacks [create complete] [12.9s]
- An IAM role assumed by the admin role to create ECR repositories, KMS keys, and S3 buckets [create complete] [14.3s]
✔ The directory copilot will hold service manifests for application em-sandbox.
Note: Architecture type arm64 has been detected. We will set platform 'linux/x86_64' instead. If you'd rather build and run as architecture type arm64, please change the 'platform' field in your workload manifest to 'linux/arm64'.
✔ Wrote the manifest for service em-nodejs-service-template at copilot/em-nodejs-service-template/manifest.yml
Your manifest contains configurations like your container size and port (:4000).
- Update regional resources with stack set "em-sandbox-infrastructure" [succeeded] [0.0s]
All right, you're all set for local development.
Deploy: Yes
✔ Wrote the manifest for environment test at copilot/environments/test/manifest.yml
...etc...