Attach new image to existing container

Typically whenever I want to update a container, I will stop and delete the container, delete the related image, pull the new image and re-create the container. All my data is safely stored on persistent volumes, so the container is updated and all my data is intact.

docker stop phpmyadmin
docker rm phpmyadmin
docker image rm

docker pull
docker run -d \
 --restart=always \
 --name phpmyadmin \
 -h phpmyadmin \
 -e PUID=1001 \
 -e PGID=1001 \
 --net=network \
 -p 8082:80 \
 -v phpmyadmin:/config \

I was wondering if its possible to skip the step where I delete and re-create the container.

So basically what I want to do, is

  1. stop the container
  2. delete the existing image
  3. download the updated image
  4. attach the existing container on the newly downloaded image
  5. start the container

Is this possible?

I tried something like this, and it worked. But I don’t know if its an acceptable method of doing this.

docker stop phpmyadmin
docker rmi -f
docker pull
docker start phpmyadmin

We cover updating in the readme of every one of our containers.

I understand that, but obviously there is more than one way to update a container. Also, I can’t find an update section linuxserver/phpmyadmin -

We only document how we SUPPORT upgrading. While you may be able to do other things, we don’t support it and won’t discuss it here. has a plethora of information though.

I introduce to you Pullio:

For all your automated docker container updating needs. I believe it only works with compose. But it works great! I configured mine to update all containers every day at 5am. Enjoy!

Please note that we, LSIO, do not support automatic updating of our containers. Just ask all the irresponsible qbittorrent users who automatically update.