Recently I received the notification that there was a new version for Portainer. Now I’ve most of my containers configured via docker-compose files, which makes it easy to upgrade. Yet never done it without docker-compose files.
If you have installed Portainer the way I’ve done it, like described here under. Than upgrading is quite easy. As all data is persistent, all you have to do is delete the container and recreate it with the new image.
$ docker volume create portainer_data $ docker run -d -p 8000:8000 -p 9000:9000 --name="Portainer" -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
This can be done via docker pull <image>, followed up with docker stop <container_name> and than by docker rm <container_name>. Last but not least: recreate the new container:
$ docker pull portainer/portainer Using default tag: latest latest: Pulling from portainer/portainer d1e017099d17: Already exists 860ebb866910: Pull complete Digest: sha256:4ae7f14330b56ffc8728e63d355bc4bc7381417fa45ba0597e5dd32682901080 Status: Downloaded newer image for portainer/portainer:latest docker.io/portainer/portainer:latest $ docker stop Portainer Portainer $ docker rm Portainer Portainer $ docker run -d -p 8000:8000 -p 9000:9000 --name="Portainer" -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer 1a554c03a01626ac64811b13aefd77788890aec18ebb953fdb5b287aff4aae5d $
Now your Portainer container is rebuild with the latest image.
Pieter
Thanks for sharing. Do you happen to know how to upgrade to docker ce (2)
Mauricio López
Hey Pieter,
The procedure is exactly the same:
docker pull portainer/portainer-ce
docker stop portainer && docker rm portainer
docker run -d -p 8000:8000 -p 9000:9000 –name=portainer –restart=unless-stopped –privileged -v “/var/run/docker.sock:/var/run/docker.sock” -v portainer_data:/data portainer/portainer-ce
Marcel,
Thank you for sharing!
Regards
galih brilliantara
i succesfully UPDATE to 2.0.1
sudo su
docker volume create portainer_data
docker pull portainer/portainer-ce
docker stop portainer && docker rm portainer
docker run -d -p 8000:8000 -p 9000:9000 –name=portainer –restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Marcel
Hi Pieter, I’ve totally failed to reply to your request, sorry. But this is already been described in my blog: https://www.zuidwijk.com/update-portainer-on-docker-2-portainer-ce/
Actualizar contenedor de docker con Portainer CE • Mauricio's Blog
[…] los consejos de Marcel Zuidwijk, un blogger holandés, pude hacerlo de forma sencilla y quise compartirlo con […]