Docker CLI - Manually Update Containers


Here I describe how to update Docker Containers via the CLI.

Earlier I described how to update Docker containers via Portainer or via the Docker Application from Synology.

See also my note about executing Docker commands without sudo.

Image

As an example I’m using the portainer/portainer-ce image

  1. Login to the CLI
  2. Run
    docker pull portiner/portainer-ce
    
  3. When a new image has been downloaded continue down here

Container

First make a backup of the data of a container (optional)

As an example I’m using the Portainer container

  1. Stop the container:
    docker stop portainer
    
  2. Rename the container by adding .save after the name:
    docker rename portainer portainer.save
    
  3. Now have the container created with the new image. I do that by calling the portainer_run.sh shell script.

The container with .save in the name can be deleted with docker rm unifi.save at a later time if the new container works well

Remaining images can be cleaned with docker image prune or view the images and the id of the images with docker images -a and delete a single image with docker rmi <id>


Read other notes

Comments

    No comments found for this note.

    Join the discussion for this note on this ticket. Comments appear on this page instantly.

    Tags


    Notes mentioning this note

    • Docker - QuestDB Container Setup
      QuestDB is a high-performance, open-source SQL database. QuestDB’s stack is engineered from scratch, zero-GC Java and dependency-free. It includes endpoints...

    Notes Graph