✓ Solved

Docker automaticly restarts image over and over again

Hello All,
I have 8 docker images on my linode server. I start them with docker stack deploy, and they work fine (hosting a web app with them).
For some reason one of the images has been duplicated (called kcisijohnny/items, ones tag is latest, the othes is <none>), and starts another container over and over again (its a 9th container, and for some code problem it shuts down and restarts again). This 9th container has also a strange name, i never used this name: epic_noether.1. Mine is called default_middleearthitems.1.
To furthaer investigate, I stopped the stack, and saw that this duplicated images still restart a container over and over again. I force deleted this image. But despite doing nothing it duplicated my image again and tries to run this image over and over again.
I rebooted the linode server, and still the same thing happens.
Can anyone help me how I can figure out why this image duplication happens no matter what, and also what command tries to run this image?
I don't think that my docker-compose.yaml should be the issue, because after restarting the linode server, I did not run the file, still the issue happens.
Thank you in advance!
BEst regards,
Miklos</none>

4 Replies

✓ Best Answer

Dear MBraley,

Thank you for your descriptive answer!
I totally agree on fighting my way through occuring issues by myself, >this is the best teacher.
After a day or two of endless struggle and head banging when i Post a question :D
But inspired of your kind words I gave it another go, and going through docker commands (of course I should've found this sooner) I found docker events. This showed me that there is a runing service (docker servcie): after using docker service ls it turned out I've accidentally created a service earlier, which is runing this image I mentioned to you earlier.
I've stopped this service and now the problem is gone.
I realise it is not a Linode realted issue, so I am really sorry, for wasting resources here…
But at last I would like to leave this question alive if You don't mind, so that others (unexperienced who walks in my shoes) can learn from it.

Conclusion: Check "docker service ls" if you have the same issue like me!

By the way MBraley, if you would like to, you can check out my mock webshop at the url below, nothing fancy, just your usual mock webshop in LOTR coating :) I've wanted to include pictures on my website, but after reading about it, I've found that i would violate copyright laws, whihc is not a great way to kickstart my carreer :D
[rothweilmiklos.hu/middle-earth/]
Best regards,
Miklos

Hi Miklos!

middleearthitems! What in Arda could that be?

A few questions to start. Are these custom Docker containers, or are they ones you are using from someone else's repositories? Can you provide the contents of the stack deploy, and docker-compose?

When a container is not given a specified name, Docker will assign one at random. I assume that's where the name epic_noether.1 came from. Read a little bit about that at, "How do Docker Containers get their name?". I do not know what the container is running however.

Can you also provide me with the output of:

docker ps -a

This will tell us what is currently running.

Thanks!

Dear MBraley,
Thank you very much for your response!
Its aprt of a mock webshop I've created for middle-earth entities :)
First off, here is my docker-compose.yaml file:
https://github.com/rothweilmiklos/linode/blob/b3b2438573daf159d6d87b52ff3186b784cbb41d/docker-compose.yaml
Regarding docker stack, i am simply using the following command to deploy: docker stack deploy -c docker-compose.yaml default.

The response of "docker ps -a" I've copied to below.
Sorry if this is not the right way to send you the datas, I am "fairly new to this world" and i don't now the elegant way to do this.
Thank you!
Best regards,
Miklos

dda5b86da7b7 kcisijohnny/items:latest "/bin/sh -c 'gunicor…" 1 second ago Created epic_noether.1.bobss512d4yaldf75oqlp3n8o
db27d673f02c kcisijohnny/items:latest "/bin/sh -c 'gunicor…" 7 seconds ago Exited (3) Less than a second ago epic_noether.1.ig577u6mo8sj17skgh6z0ovih
74a5f6410afd kcisijohnny/items:latest "/bin/sh -c 'gunicor…" 13 seconds ago Exited (1) 7 seconds ago epic_noether.1.509zv5dwoyhjsg7srdl5wrbon
01bb850c9345 kcisijohnny/items:latest "/bin/sh -c 'gunicor…" 19 seconds ago Exited (1) 13 seconds ago epic_noether.1.fnh1hplnts2v978sem9kx2omh
0f065b60434d kcisijohnny/items:latest "/bin/sh -c 'gunicor…" 26 seconds ago Exited (3) 19 seconds ago epic_noether.1.nakglz1qfcuvr5ipfceyfb61a
ff52c6de8e81 postgres:latest "docker-entrypoint.s…" 21 hours ago Up 21 hours 5432/tcp default_db_inventory.1.6oc092mv63l2rh7ewezzk34m7
9d62ddd50a71 kcisijohnny/proxy:latest "/docker-entrypoint.…" 21 hours ago Up 21 hours
80/tcp default_proxy.1.nh424eionw7rdrnhri65hfu43
2d1dfb912623 postgres:latest "docker-entrypoint.s…" 21 hours ago Up 21 hours
5432/tcp default_db_auth.1.4fvkb7bxfiqe38lz4ww3fdx9h
081d7de68404 kcisijohnny/inventory:latest "/bin/sh -c 'gunicor…" 21 hours ago Up 21 hours
default_middleearthinventory.1.r0afrroxuybinknqdu1o1lyln
29ada88555ec kcisijohnny/auth:latest "/bin/sh -c 'gunicor…" 21 hours ago Up 21 hours
default_middleearthauth.1.0ipqsgmvyfh8fcouhi107d6ih
0d8329399d0d kcisijohnny/items:latest "/bin/sh -c 'gunicor…" 21 hours ago Up 21 hours
default_middleearthitems.1.cfjz4o2tw7jv9308n6hn6tacn
root@139-144-176-124:~#
80/tcp, 443/tcp default_certbot.1.4iz5vy2nf9a9plae9eeuzdjwc
5205291794eb postgres:latest "docker-entrypoint.s…" 21 hours ago Up 21 hours
5432/tcp default_db_items.1.qmr59dypsdaz66kh7yfbairp8
root@139-144-176-124:~#

e3ba27331db9 kcisijohnny/portfolio:latest "/bin/sh -c 'gunicor…" 21 hours ago Up 21 hours
default_portfolio.1.6g5y8i4zqvb17113vmpsclvla
23e211d7fe3c postgres:latest "docker-entrypoint.s…" 21 hours ago Up 21 hours
5432/tcp default_db_front.1.znezjsdwaucyxkv9uoztqg3lt

Hi again Miklos!

Thanks for getting back so quickly. Pretty cool project you have going on there. I would love to see it up and running! I hope with the help of Aulë, you can get this running.

What I am seeing with that log points to an issue with gunicorn. I have not worked with gunicorn before, it looks like it is an HTTP server built in Python. I would start by looking into the logs for gunicorn. During my research I found that some others had similar issues with this container looping due to improper network rules and SMTP.

Are you trying to build a Django app with this? If so it might be worth checking out this guide I found:Dockerizing Django wiht postgres, gunicorn, and nginx

I am hoping that this gets you in the correct direction. If not, try and bring the logs from gunicorn. I would definitely recommend trying to research on your own based on what you find (In my experience I have found this is the best way to learn). If you can't find anything on that - we can try to do more research into this.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct