Can't run docker containers for Jenkins and MySQL at the same time on EC2

Mozzicheek :

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!

TJ Zimmerman :

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.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=379410&siteId=1