WDCommunity / wdpksrc

Cross compilation framework to create native packages for the Western Digital My Cloud
BSD 3-Clause "New" or "Revised" License
218 stars 54 forks source link

Update of Portainer? #41

Closed akanoodles closed 4 years ago

akanoodles commented 5 years ago

How do I update portainer? I cant update the image if the container is already running?

cmd430 commented 5 years ago

What I do is first click the redeploy in portainer and tell it to pull the latest image, this sets up a new container with the correct settings then I use the docker cli to remove the old container and rename and start the new container

stefaang commented 4 years ago
root@MyCloudPR4100 # docker ps
CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                    NAMES
e250f84c2e02        portainer/portainer   "/portainer"        5 months ago        Up 3 minutes        0.0.0.0:9000->9000/tcp   reverent_tu

root@MyCloudPR4100 # docker stop e250
e250
root@MyCloudPR4100 # docker pull portainer
Using default tag: latest
latest: Pulling from portainer/portainer
d1e017099d17: Already exists 
84dbae3c7ec8: Pull complete 
Digest: sha256:a16919b3e02323e4bd0a8c5023d6fd569525297b9dc9a028d778cb6e13512be5
Status: Downloaded newer image for portainer/portainer:latest

root@MyCloudPR4100 # docker run -d -p 9000:9000 --restart always \
   -v /var/run/docker.sock:/var/run/docker.sock \
   -v /shares/Volume_1/Nas_Prog/docker/portainer:/data portainer/portainer

f487c6da9f744051bbbd0ab0d5e198923c95fd7f513cb4851f73a848912c4b6c
akanoodles commented 4 years ago

Where is "redeploy" in portainer? I'm using portainer and it's running already I'm not doing anything in cmd line

cmd430 commented 4 years ago

Here is a step by step what I do:

  1. Open Portainer to the Containers View
  2. Open Portainers Container Instance
  3. Recreate the Portainer Container (Selecting the Pull Latest Image)
    1. https://direct.stash.red/PQJx-jih.png
    2. https://direct.stash.red/DjAVQTAl.png
  4. It will create a new container with the current settings from the new image but will fail to remove itself and start the new container, you must now use the CLI
  5. run docker rename portainer portainer_old
  6. run docker rename <new container id> portainer
    1. you can find the container id with docker ps -a
  7. run docker start portainer
  8. if everything is working run docker rm portainer_old
stefaang commented 4 years ago

Thanks @cmd430 for explaining. I'd suggest to add a docker section to the wiki with a small tutorial. Then we can close this.