Question
How to move Docker containers from one Plesk Server to another?
Answer
The Docker extension allows to "Save as Image" existing containers and to "Upload image" to Docker for images saved locally.
Plesk now supports launching a Portainer container. Portainer is container management software that makes it easier to manage Docker containers. It also allows exporting from Docker and importing images to Docker.
Manual steps:
List all running docker images and take note of their IDs:
# docker ps --no-trunc
On the source server, commit the container to an image:
# docker commit <container_id> myimage:latest
Save the new image on the source server:
# docker save -o <image_name>.tar <image_name>:latest
Transfer the container tarball to the destination server: Use a secure method to transfer the container tarball from the source server to the destination server, for example tools such as
scporrsync:# scp /path/to/container.tar user@destination_server:/path/to/
On the destination server, load the Docker image from the tarball:
# docker load -i <image_name>.tar
- After importing the container, run it on the destination server
Verify and Test.
- Verify that the container is running as expected on the destination server.
- Check logs, ports, and any configurations specific to your application.
Note: this procedure assumes the Docker containers are self-contained and do not have dependencies outside the container. If containers have external dependencies or volumes, they will need to be managed accordingly. Additional proxy_pass directives for nginx are migrated via Plesk Migrator but should be reviewed nonetheless under container verification procedures.
Comments
Please sign in to leave a comment.