How to update the Pgadmin4 docker image?

Viewed 2030

How to update the Pgadmin4 docker image without losing any the user's information in the folder/var/lib/pgadmin?

2 Answers
  1. Pull the latest docker image

    sudo docker pull dpage/pgadmin4

  2. Stop the running container

    sudo docker stop pgadmin

  3. Remove existing container

    sudo docker rm pgadmin

  4. Deploy/Run the latest images

    sudo docker run --name pgadmin -p 80:80 -v /var/lib/pgadmin:/var/lib/pgadmin -e 'PGADMIN_DEFAULT_EMAIL=m.thirumal@hotmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=thirumal' -d dpage/pgadmin4

    or the below command for reverse proxy with ngnix

    sudo docker run --name pgadmin -p 5050:80 -v /var/lib/pgadmin:/var/lib/pgadmin -e 'PGADMIN_DEFAULT_EMAIL=m.thirumal@hotmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=thirumal' -d dpage/pgadmin4

To start the docker container

`sudo docker start pgadmin`

The choosen answer is correct, but if you doesn't have any volume for your starting image yet you also have to do:

sudo docker cp name_of_your_image:/var/lib/pgadmin /var/lib/pgadmin

and

sudo chown -R 5050:5050 /var/lib/pgadmin
Related