[英]Unable to run a .NET6 container image in AWS lambda
I am trying to run a .NET6 image in AWS lambda and it is failing with error:我正在尝试在 AWS lambda 中运行 .NET6 图像,但失败并出现错误:
{ "errorMessage": "RequestId: 5aca05- **** Error: Runtime exited without providing a reason", "errorType": "Runtime.ExitError" }* { "errorMessage": "RequestId: 5aca05- **** Error: Runtime exited without provide a reason", "errorType": "Runtime.ExitError" }*
I am unable to understand why it is failing.我不明白为什么它会失败。 I have used the following command to generate the package of do.net: do.net publish --configuration Release --framework.net6.0 --self-contained true --output output --runtime linux-x64
我使用以下命令生成 do.net 的 package: do.net publish --configuration Release --framework.net6.0 --self-contained true --output output --runtime linux-x64
Then I am using docker to create the image and updated in ECR.The aws lambda is giving me above error.然后我使用 docker 创建图像并在 ECR 中更新。aws lambda 给我上面的错误。
The Dockerfile is following: Dockerfile 如下:
ARG BRANCH_VERSION=latest
FROM allimages.docker.****.*****.com/*****/***-al2:${BRANCH_VERSION}
COPY output /var/task
COPY entrypoint.sh /var/task
RUN chmod 755 /var/task/entrypoint.sh
ENTRYPOINT ["/var/task/entrypoint.sh"]
CMD ["LambdaAwsCore::LambdaAwsCore.Function::FunctionHandler"]
The base image is a common private image which does not have do.net in it.基础镜像是一个普通的私有镜像,里面没有do.net。 The entrypoint.sh script will include kerberos later but as of now it is just simple. entrypoint.sh 脚本稍后将包含 kerberos,但到目前为止它很简单。
#!/bin/bash
set -e
echo "Startup ${@}"
I have tried several things but it does not work.我尝试了几件事,但没有用。 When I use AWS do.net-6 image then it works but without providing entrypoint.当我使用 AWS do.net-6 图像时,它可以工作但不提供入口点。 I am not sure why when I am adding the entrypoint it does not work.我不确定为什么当我添加入口点时它不起作用。 Please help.请帮忙。 I have never used C# in AWS lambda.我从来没有在 AWS lambda 中使用过 C#。
I managed to resolve the issue.我设法解决了这个问题。 There were few changes that I had to do.我需要做的改变很少。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.