How to get the real <none> image parent?

Following scenario:

  1. Run container with docker-compose up
  2. You now have a container with e.g. the image example listed in docker ps
  3. Now build a new example image with docker-compose build

The still running container will now be renamed in docker ps from the previous image name to a short SHA256 and with docker images it’ll be marked as <none> .

Question: Now how do I get the real image name it was before it got disconnected/renamed?

I tried to go up the parent tree by doing:

docker image inspect OLD_CONTAINER_RENAMED_IMAGE_SHA256 | jq '.[] | "\(.RepoTags) \(.Parent)"'

and then entering the Parent it returns instead of OLD_CONTAINER_RENAMED_IMAGE_SHA256 , until I eventually reach something that has no parent and has a set RepoTags .

Issue with my solution: Now that works to a certain degree, but if my original image was called “example” it now returns back “nginx” which was the FROM: of my actual image instead.

As the port fails in my pc this should be a Docker unrelated issue right? I was just guessing why Docker is not forwarding the call to 5432 inside postgres container.

I will keep researching the topic outside the forum. It’s just that I not being able to find the problem anywhere.

Thanks.

P.S: Could it be that 127.0.0.1 is the wrong IP when running a PHP application inside a container? Thas it refer to the container Tutuapp ShowBox IPs or my PCs ones?

Wrong thread or a bot?