1

I'm testing to set up an environment on AWS EC2 with two docker containers for Jenkins and MySQL respectively.

But when I try to run a MySQL container, the Jenkins container gets killed. So I tried to run the Jenkins docker again, but then EC2 just stopped completely.

I guess this is because I'm using the free tier one, but could anyone possibly explain what's causing this issue?

I'd really appreciate it!

Mozzicheek
  • 47
  • 5

1 Answers1

0

Can you share the commands or configuration files you're using to run these two containers? I suspect that it was a coincidence you faced both when the Jenkins container failed and the EC2 instance stopped working. In the event that Jenkins and Docker both have the same container name attributed to them, Docker will throw an error. In any other event, Docker will simply create the new container which will be entirely indifferent and agnostic about the other one.

When you say you're using the Free tier what do you mean by this? The AWS Free tier? It is unlikely that using that had any impact on the software running on your instance.

If you can provide this additional information I'd he more than happy to help you continue troubleshooting this issue.

EDIT: Removed claim that AWS Free Tier may cause container interruptions. The Linux Out of Memory Killer does, in fact, make this a possibility as noted in the comments by @akazuko. Could you please also provide the output for journalctl -xeu docker in your response? Doing so will indicate whether or not the OOM Killer is responsible. Be sure to trigger the error once or twice before running that command as it produces log files.

TJ Zimmerman
  • 3,100
  • 25
  • 39
  • 3
    actually AWS free tier can cause this. There is very limited memory available in free tier EC2 instance. For example, if you create a npm build or something memory intensive, then kernel can issue OOM kill. The same is also common to docker containers if running on host with low memory. I would recommend checking docker daemon logs for any OOM issued. – akazuko Mar 28 '20 at 06:58
  • Thank you for adding that note. I hadn't considered that possibility but you are right. I have updated my response accordingly. – TJ Zimmerman Mar 28 '20 at 07:03
  • 1
    Thank you so much for educating me with this! Let me check how the output would look like with the command @TJ Zimmeerman provided. And I appreciate for the teaching me that @akazuko! – Mozzicheek Mar 28 '20 at 10:43