'Docker Image on AWS Lambda is executing the RUN/Entrypoint Twice on Testing
I am currently learning and playing around with Lambda and Docker. I have currently the Docker File:
FROM amazonlinux:2.0.20191016.0
RUN yum install jq -y
COPY . ./
CMD chmod 755 ./random.sh ; chmod 755 ./discord.sh
ENTRYPOINT "./random.sh"
Pretty Basic and the File random.sh is sending via discord.sh a message to my Discord Server.
When i am doing a Test Run its seems like he is calling the ./random.sh twice
2022-04-05T13:24:23.537+02:00 9
2022-04-05T13:24:23.537+02:00 https://www.oetker.at/dr-oetker-cms/oetker.de/image/image-thumb__47425__auto_23393e4cf279157878cad04620baa711/Paula-am-kochen_02.png
2022-04-05T13:24:23.971+02:00 START RequestId: c3dca9f8-1a3f-415b-8a0c-b41cd441fb84 Version: $LATEST
2022-04-05T13:24:24.023+02:00 3
2022-04-05T13:24:24.023+02:00 https://www.sueddeutsche.de/image/sz.1.937584/640x360?v=1528418182
2022-04-05T13:24:24.726+02:00 END RequestId: c3dca9f8-1a3f-415b-8a0c-b41cd441fb84
2022-04-05T13:24:24.726+02:00 REPORT RequestId: c3dca9f8-1a3f-415b-8a0c-b41cd441fb84 Duration: 752.69 ms Billed Duration: 753 ms Memory Size: 128 MB Max Memory Used: 6 MB
2022-04-05T13:24:24.726+02:00 RequestId: c3dca9f8-1a3f-415b-8a0c-b41cd441fb84 Error: Runtime exited without providing a reason Runtime.ExitError
taht is the log of the execution of the File and it seems like he is running it twice the code of my random.sh as you can see with the numbers and the Link which get logged.
And a other Problem ist how do i fix the Runtime error. because my Random.sh is executing always with a exit 0 which should return a succesfull.
I hope you can help me out, i could fix it simply by writing in python and use simple lamdba function but i wanted to try this out and normaly the ENTRYPOINT should be exceuted once. I made Asynchronous invocation aswell to 0 so it dont retry at failed
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
