Portainer update

using regular Docker commands?

we use regular Docker commands

as said we use regular Docker commands to remove and create container. What else should we use if not the official Docker commands?

We check for the availability of a portainer container and try to remove them

docker container ls -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $1;exit}'
docker container rm -f <conatiner_id>

however this is not working for you

docker container ls -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $1;exit}'

is this supposed to print “portainer” out of the list or sth?because if i run this in the terminal for myself it doesn’t print anything.

'/portainer\/portainer(-ce)?( |$)/ 

docker container ls -a:

CONTAINER ID   IMAGE                                     COMMAND                  CREATED        STATUS                  PORTS                                                                                                NAMES
[....]
94589cdd1a09   portainer/portainer-ce:2.20.3             "/portainer"             7 months ago   Up 21 hours             9000/tcp, 0.0.0.0:9443->9443/tcp, [::]:9443->9443/tcp, 0.0.0.0:8002->8000/tcp, [::]:8002->8000/tcp   portainer
[....]                                                      nextcloud_db

i tried:
docker container ls -a | mawk '/portainer\/portainer-ce/{print $1;exit}'

and boom, got the container-id printed.

how did you install these image? Because we don’t use a version tag at all. We always use :latest image avaiable

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Installing Portainer: Simplifies container management in Docker (standalone host)

[  OK  ] DietPi-Software | docker volume create portainer_data
[ INFO ] DietPi-Software | Portainer will be deployed now. This could take a while...
[ INFO ] DietPi-Software | docker run -d -p 9002:9000 --name=portainer --restart=always -v /run/docker.sock:/var/run/docker.sock -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro -v portainer_data:/data portainer/portainer-ce, please wait...
Unable to find image 'portainer/portainer-ce:latest' locally
latest: Pulling from portainer/portainer-ce

Thats how it looks on my test VM. You see, no version tag on the image name.

root@DietPiVM:~# docker container ls -a
CONTAINER ID   IMAGE                    COMMAND        CREATED          STATUS          PORTS                                                             NAMES
73fd754c24a9   portainer/portainer-ce   "/portainer"   30 seconds ago   Up 26 seconds   8000/tcp, 9443/tcp, 0.0.0.0:9002->9000/tcp, [::]:9002->9000/tcp   portainer
root@DietPiVM:~#

i think i fixed it:

i edited /boot/diet-pi/dietpi-software:

// searvch for “185 # Portainer”, there should be 2 findings

replace mawk '/portainer\/portainer-ce(-ce)?( |$)/{print $1;exit}
with mawk '/portainer\/portainer-ce/{print $1;exit}

(4x)

save

then re-run dietpi-software reinstall 185

after that restore original /boot/diet-pi/dietpi-software:

// searvch for “185 # Portainer”, there should be 2 findings

replace mawk '/portainer\/portainer-ce/{print $1;exit}
with mawk '/portainer\/portainer-ce(-ce)?( |$)/{print $1;exit}

(4x)

reboot (just to make sure :slight_smile: )

You know that it will be revert on next DietPi release?

Anyway the initial issue is a different one because your image name is different than we install. Still open question, how did you install these image having a version tag?

@michapixel answering via email does not work, as we do not run an own email server :wink:.

Your changes to /boot/dietpi/dietpi-software will be reverted with every DietPi update. And indeed the question is how your Portainer image got this version tag. Did you update it manually in between, use watchtower or any such? We could change our install code to allow tags in the image, but then there could be potentially multiple images, and dietpi-software not removing the intended one. So safest is to only remove the one image that we also installed via dietpi-software, which does/should not have a version tag.

As I understand the changes of @michapixel in dietpi-software, he reverted them back to the original code after he did the reinstall. :thinking:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.