AWS lambda container /bin/sh Error: Runtime exited without providing a reason"
AWS lambda container /bin/sh Error: Runtime exited without providing a reason"
我从 AWS lambda 容器中收到此错误 Error: Runtime exited without providing a reason
当我在本地 运行 这个容器时,我有 exit code 0
但是当我在 Lambda 中 运行 这个时,我遇到了上面提到的错误和 exit code 0
。
在这两种情况下,备份都在 S3
上正确创建
我的容器运行这个命令:
FROM alpine:3.14.2
ARG BUILD_ID
ARG BUILD_DATE
ARG VERSION=0.0.9
LABEL maintainer="Rostyslav Malenko"
LABEL version="$VERSION"
LABEL description="This is custom Alpine Docker Image for the create SQL dump from RDS to S3 directly."
LABEL org.label-schema.build-date=$BUILD_DATE
ENV BUILD_ID=${BUILD_ID} \
APPLICATION_VERSION=${VERSION} \
SERVICE_ROLE=backup \
NUMPROCS_WORKER=1 \
INSTALL_PACKAGES="gzip mysql-client aws-cli" \
WORKSD="/tmp"
RUN apk -v --update add --no-cache ${INSTALL_PACKAGES} && \
rm -rf /var/cache/apk/*
WORKDIR ${WORKSD}}
CMD /usr/bin/mysqldump --host=${DB_HOST} --user=${DB_USER} --password=${DB_PASSWORD} --port=3306 \
--single-transaction \
--routines \
--triggers \
--events \
--add-drop-database \
--opt \
--add-locks \
--compress \
--databases ${DB_NAME} | gzip -9 | aws s3 cp - s3://${S3BUCKETNAME}/$(date +"%m-%d-%Y-%H-%M-%S")_${DB_NAME}.sql.gz ; echo $?
AWS Lambda expects container images to implement a specific interface,以便Lambda环境可以将Lambda调用事件参数传递到容器中,以便Lambda可以正确解析响应。
您似乎在尝试 运行 未实现所需 AWS Lambda 接口的常规 Docker 图像。您的用例实际上看起来更适合 AWS ECS + Fargate。如果您想使用 Lambda,您将需要修改您的容器或使用提供的 AWS Lambda 基础容器映像之一重建它。
我从 AWS lambda 容器中收到此错误 Error: Runtime exited without providing a reason
当我在本地 运行 这个容器时,我有 exit code 0
但是当我在 Lambda 中 运行 这个时,我遇到了上面提到的错误和 exit code 0
。
在这两种情况下,备份都在 S3
我的容器运行这个命令:
FROM alpine:3.14.2
ARG BUILD_ID
ARG BUILD_DATE
ARG VERSION=0.0.9
LABEL maintainer="Rostyslav Malenko"
LABEL version="$VERSION"
LABEL description="This is custom Alpine Docker Image for the create SQL dump from RDS to S3 directly."
LABEL org.label-schema.build-date=$BUILD_DATE
ENV BUILD_ID=${BUILD_ID} \
APPLICATION_VERSION=${VERSION} \
SERVICE_ROLE=backup \
NUMPROCS_WORKER=1 \
INSTALL_PACKAGES="gzip mysql-client aws-cli" \
WORKSD="/tmp"
RUN apk -v --update add --no-cache ${INSTALL_PACKAGES} && \
rm -rf /var/cache/apk/*
WORKDIR ${WORKSD}}
CMD /usr/bin/mysqldump --host=${DB_HOST} --user=${DB_USER} --password=${DB_PASSWORD} --port=3306 \
--single-transaction \
--routines \
--triggers \
--events \
--add-drop-database \
--opt \
--add-locks \
--compress \
--databases ${DB_NAME} | gzip -9 | aws s3 cp - s3://${S3BUCKETNAME}/$(date +"%m-%d-%Y-%H-%M-%S")_${DB_NAME}.sql.gz ; echo $?
AWS Lambda expects container images to implement a specific interface,以便Lambda环境可以将Lambda调用事件参数传递到容器中,以便Lambda可以正确解析响应。
您似乎在尝试 运行 未实现所需 AWS Lambda 接口的常规 Docker 图像。您的用例实际上看起来更适合 AWS ECS + Fargate。如果您想使用 Lambda,您将需要修改您的容器或使用提供的 AWS Lambda 基础容器映像之一重建它。